Replace Tailwind CDN with pre-built CSS via standalone CLI

- Add shared/static/styles/tailwind.css as Tailwind v4 input with
  explicit @source paths for all service templates and safelisted
  dynamic classes (bg-{colour}-{shade}, text-{size})
- Build to shared/static/styles/tw.css (93KB minified)
- Replace <script src="cdn.tailwindcss.com"> with <link> to tw.css
  in sx page shell, Jinja _head.html, and ~base-shell component
- Add build-tw.sh convenience script

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-01 17:23:20 +00:00
parent b54f7b4b56
commit 01a67029f0
6 changed files with 44 additions and 3 deletions

9
build-tw.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/usr/bin/env bash
# Build Tailwind CSS from source templates.
# Requires: tailwindcss CLI standalone binary on PATH.
# curl -sL https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-linux-x64 \
# -o /usr/local/bin/tailwindcss && chmod +x /usr/local/bin/tailwindcss
set -euo pipefail
cd "$(dirname "$0")"
tailwindcss -i shared/static/styles/tailwind.css -o shared/static/styles/tw.css --minify
echo "Built shared/static/styles/tw.css ($(wc -c < shared/static/styles/tw.css) bytes)"