Add TypeScript theme generator for doki-master-theme palettes

Generates one Gitea-compatible CSS theme file per doki-master-theme
definition (88 themes). Each file contains a gitea-theme-meta-info
block and a :root block with the full set of CSS custom properties
derived from the character's colour palette.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-22 17:38:38 +00:00
commit f2baf869c9
12 changed files with 1388 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
import type { ThemeConfig } from './types.js';
export function renderThemeCSS(theme: ThemeConfig, variables: Record<string, string>): string {
const isDark = theme.colorScheme === 'dark';
const lines: string[] = [];
lines.push('gitea-theme-meta-info {');
lines.push(` --theme-display-name: "${theme.displayName}";`);
lines.push(` --theme-color-scheme: "${theme.colorScheme}";`);
lines.push('}');
lines.push('');
lines.push(':root {');
for (const [name, value] of Object.entries(variables)) {
lines.push(` ${name}: ${value};`);
}
// Native CSS properties at the end (not custom properties)
lines.push(` accent-color: var(--color-accent);`);
lines.push(` color-scheme: ${isDark ? 'dark' : 'light'};`);
lines.push('}');
lines.push('');
return lines.join('\n');
}