import type { ThemeConfig } from './types.js'; export function renderThemeCSS(theme: ThemeConfig, variables: Record): 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'); }