restructure theme css

This commit is contained in:
2026-07-17 16:58:16 -04:00
parent 35f0ea6db3
commit 03b5bea72d
11 changed files with 117 additions and 166 deletions

View File

@@ -55,5 +55,28 @@ func CompileFiles(entryCSS, baseDir string, sourceGlobs []string) (string, error
return Minify(compiled)
}
// CompileApp is Compile with kjol's shared extension layer prepended to entryCSS —
// the layering every kjol front-end (Solid and gowasm) shares:
//
// base Tailwind → kjol extensions (kjol_theme.css) → the app's brand entryCSS
//
// The kjol layer does the `@import "tailwindcss"` and defines the semantic tokens,
// the class-based dark variant and the chart palette, so entryCSS carries only
// brand. Compile itself stays a plain Tailwind engine (no kjol tokens) for callers
// that want exactly that.
func CompileApp(entryCSS, baseDir string, candidates []string) (css string, utilities int, err error) {
return twCompile(kjolThemeCSS+"\n"+entryCSS, baseDir, candidates)
}
// CompileAppFiles is Scan + CompileApp + minify: CompileFiles with the kjol
// extension layer prepended.
func CompileAppFiles(entryCSS, baseDir string, sourceGlobs []string) (string, error) {
compiled, _, err := CompileApp(entryCSS, baseDir, scanSources(baseDir, sourceGlobs))
if err != nil {
return "", err
}
return Minify(compiled)
}
// Minify shrinks compiled CSS.
func Minify(css string) (string, error) { return minifier.String("text/css", css) }