mirror of
https://gitea.catppuccin.com/catppuccin/gitea
synced 2024-12-14 03:06:21 +00:00
46 lines
1019 B
TypeScript
Executable File
46 lines
1019 B
TypeScript
Executable File
#!/usr/bin/env -S deno run --allow-read --allow-write --allow-run --allow-env
|
|
|
|
import { path, sass } from "./deps.ts";
|
|
|
|
const accents = [
|
|
"rosewater",
|
|
"flamingo",
|
|
"pink",
|
|
"mauve",
|
|
"red",
|
|
"maroon",
|
|
"peach",
|
|
"yellow",
|
|
"green",
|
|
"teal",
|
|
"sky",
|
|
"sapphire",
|
|
"blue",
|
|
"lavender",
|
|
];
|
|
|
|
const flavors = ["latte", "frappe", "macchiato", "mocha"];
|
|
|
|
const dirname = path.dirname(path.fromFileUrl(import.meta.url));
|
|
const builder = (flavor: string, accent: string) => `
|
|
@import "catppuccin/${flavor}";
|
|
$accent: $${accent};
|
|
$is-dark: ${flavor !== "latte"};
|
|
@import "theme";
|
|
`;
|
|
|
|
for (const flavor of flavors) {
|
|
for (const accent of accents) {
|
|
const input = builder(flavor, accent);
|
|
const result = await sass.compileStringAsync(input, {
|
|
loadPaths: [path.join(dirname, "src")],
|
|
});
|
|
|
|
Deno.mkdirSync(path.join(dirname, "dist"), { recursive: true });
|
|
await Deno.writeTextFile(
|
|
path.join(dirname, "dist", `theme-catppuccin-${flavor}-${accent}.css`),
|
|
result.css
|
|
);
|
|
}
|
|
}
|