restructure theme css
This commit is contained in:
23
go/tw/tw.go
23
go/tw/tw.go
@@ -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) }
|
||||
|
||||
Reference in New Issue
Block a user