initial port of the UI kit
This commit is contained in:
19
go/bundler/public_tailwind.go
Normal file
19
go/bundler/public_tailwind.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package bundler
|
||||
|
||||
// CompileTailwind compiles a Tailwind v4 entry stylesheet with kjol's native
|
||||
// engine, discovering utility candidates from the given source globs (relative
|
||||
// to baseDir). The scanner is language-agnostic — it extracts candidate class
|
||||
// tokens from any text file — so this works for markup authored in Go (e.g. the
|
||||
// go-wasm-web example's webui components) just as well as .tsx/.html.
|
||||
//
|
||||
// entryCSS is the stylesheet source (typically `@import "tailwindcss";` plus an
|
||||
// `@theme { … }` block). Returns minified CSS. This is the app-bundler engine
|
||||
// (twCompile/scanSources) exposed for consumers that don't go through Build.
|
||||
func CompileTailwind(entryCSS, baseDir string, sourceGlobs []string) (string, error) {
|
||||
candidates := scanSources(baseDir, sourceGlobs)
|
||||
compiled, _, err := twCompile(entryCSS, baseDir, candidates)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return m.String("text/css", compiled)
|
||||
}
|
||||
Reference in New Issue
Block a user