Skip to content

feat(webui): vendor Tailwind via go:embed (#1601)#1604

Merged
nextlevelshit merged 1 commit into
mainfrom
1601-tailwind-vendored-compile
Apr 30, 2026
Merged

feat(webui): vendor Tailwind via go:embed (#1601)#1604
nextlevelshit merged 1 commit into
mainfrom
1601-tailwind-vendored-compile

Conversation

@nextlevelshit
Copy link
Copy Markdown
Collaborator

Summary

  • Replace runtime cdn.tailwindcss.com script with build-time-compiled, embedded /static/tailwind.css
  • Add Tailwind v3 source (tailwind.input.css, tailwind.config.js) with content glob over internal/webui/templates
  • Commit minified internal/webui/static/tailwind.css so plain go build works without Node or Tailwind CLI
  • Makefile tailwind target downloads pinned v3.4.17 standalone binary into tools/; tailwind-check regenerates + git diff --exit-code for CI drift detection
  • Test guards CSS embed, non-empty output, custom props, and CDN regression in templates

Related to #1601

Changes

  • internal/webui/tailwind.input.css, internal/webui/tailwind.config.js — Tailwind v3 source + config
  • internal/webui/static/tailwind.css — minified output, embedded via existing //go:embed static/*
  • internal/webui/templates/work/{board,detail}.html — drop CDN <script>, use embedded stylesheet
  • internal/webui/tailwind_test.go — embed assertions + CDN regression guard
  • Makefiletailwind and tailwind-check targets
  • docs/build.md — front-end build docs incl. npx fallback
  • .gitignore — ignore tools/ directory

Test Plan

  • go test ./internal/webui/... — embed + regression guards pass
  • make tailwind-check — regenerated output matches committed CSS
  • Manual: go build ./... && wave webui — board/detail render with Tailwind utilities, no network requests to cdn.tailwindcss.com

Replace runtime cdn.tailwindcss.com script in templates/work/{board,detail}.html
with a build-time-compiled, embedded /static/tailwind.css. The compiled file is
committed so plain go build still works without Node or the Tailwind CLI.

- internal/webui/tailwind.{input.css,config.js}: Tailwind v3 source + content
  glob over internal/webui/templates
- internal/webui/static/tailwind.css: minified output, embedded via existing
  //go:embed static/* directive
- Makefile: tailwind target downloads pinned v3.4.17 standalone binary into
  tools/ (gitignored); tailwind-check regenerates + git diff --exit-code for
  CI drift detection
- internal/webui/tailwind_test.go: asserts CSS embedded, non-empty, contains
  --tw- custom props + bg-slate-50 utility; guards templates against CDN
  regression
- docs/build.md: front-end build steps + npx fallback path
@nextlevelshit nextlevelshit merged commit 111657f into main Apr 30, 2026
9 checks passed
@nextlevelshit nextlevelshit deleted the 1601-tailwind-vendored-compile branch April 30, 2026 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant