2023-03-26 11:16:45 -04:00
|
|
|
const fs = require("fs");
|
|
|
|
const path = require("path");
|
|
|
|
const sass = require("sass");
|
|
|
|
const ctp = require("@catppuccin/palette");
|
|
|
|
|
|
|
|
const builder = (flavor, accent) => `
|
|
|
|
@import "@catppuccin/palette/scss/${flavor}";
|
|
|
|
$accent: $${accent};
|
|
|
|
$isDark: ${flavor !== "latte"};
|
|
|
|
@import "theme";
|
|
|
|
`;
|
|
|
|
|
2023-03-26 12:05:15 -04:00
|
|
|
const accents = [
|
|
|
|
"rosewater",
|
|
|
|
"flamingo",
|
|
|
|
"pink",
|
|
|
|
"mauve",
|
|
|
|
"red",
|
|
|
|
"maroon",
|
|
|
|
"peach",
|
|
|
|
"yellow",
|
|
|
|
"green",
|
|
|
|
"teal",
|
|
|
|
"sky",
|
|
|
|
"sapphire",
|
|
|
|
"blue",
|
|
|
|
"lavender",
|
|
|
|
];
|
|
|
|
|
2023-03-26 11:16:45 -04:00
|
|
|
for (const flavor of Object.keys(ctp.variants)) {
|
2023-03-26 12:05:15 -04:00
|
|
|
for (const accent of accents) {
|
2023-03-26 11:16:45 -04:00
|
|
|
const input = builder(flavor, accent);
|
|
|
|
const result = sass.compileString(input, {
|
|
|
|
loadPaths: [
|
|
|
|
path.join(__dirname, "src"),
|
|
|
|
path.join(__dirname, "node_modules"),
|
|
|
|
],
|
|
|
|
});
|
|
|
|
|
|
|
|
fs.mkdirSync(path.join(__dirname, "dist"), { recursive: true });
|
|
|
|
fs.writeFileSync(
|
|
|
|
path.join(__dirname, "dist", `theme-catppuccin-${flavor}-${accent}.css`),
|
|
|
|
result.css
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|