|
|
|
@ -134,6 +134,8 @@ ${love[1].colors.grays
|
|
|
|
|
htmlclean(nunjucks.render('get.html', {love, markdown, title}))
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await writeCustomProperties(love, versions['css-custom-properties']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function capitalize(word: string): string {
|
|
|
|
@ -145,6 +147,42 @@ export async function writeJSON(path: string, data: unknown): Promise<void> {
|
|
|
|
|
await fsp.writeFile(path, JSON.stringify(data, null, 2));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export async function writeCustomProperties(
|
|
|
|
|
love: LoveVariant[],
|
|
|
|
|
version: string
|
|
|
|
|
): Promise<void> {
|
|
|
|
|
let css = `/*
|
|
|
|
|
The Love Theme CSS Custom Properties
|
|
|
|
|
https://love.holllo.cc - version ${version}
|
|
|
|
|
MIT license
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
.love {\n`;
|
|
|
|
|
|
|
|
|
|
for (const variant of love) {
|
|
|
|
|
const prefix = variant.name === 'dark' ? 'd' : 'l';
|
|
|
|
|
css += ` /* Love ${capitalize(variant.name)} */\n`;
|
|
|
|
|
css += ` --${prefix}f-1: ${variant.colors.foreground1};\n`;
|
|
|
|
|
css += ` --${prefix}f-2: ${variant.colors.foreground2};\n`;
|
|
|
|
|
css += ` --${prefix}b-1: ${variant.colors.background1};\n`;
|
|
|
|
|
css += ` --${prefix}b-2: ${variant.colors.background2};\n`;
|
|
|
|
|
|
|
|
|
|
for (const [index, color] of variant.colors.accents.entries()) {
|
|
|
|
|
css += ` --${prefix}a-${index + 1}: ${color};\n`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (const [index, color] of variant.colors.grays.entries()) {
|
|
|
|
|
css += ` --${prefix}g-${index + 1}: ${color};\n`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
css += '\n';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
css = css.trim();
|
|
|
|
|
css += '\n}\n';
|
|
|
|
|
await fsp.writeFile(join(__dirname, '../../public/love.css'), css);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (require.main === module) {
|
|
|
|
|
void main();
|
|
|
|
|
}
|
|
|
|
|