fix: enforce local TailwindCSS builds, reject CDN usage

- Update verification script to check for /static/style.css (local build)
- Reject cdn.tailwindcss.com usage (violates production-ready requirement)
- Local builds are faster, have no external dependencies, and are self-contained
- Changes verification from WARNING to ERROR when CDN is detected
- Now passes all 26 checks with 0 warnings, 0 errors
This commit is contained in:
2026-02-03 09:44:39 -05:00
parent 4d2069abdb
commit 0c5c7e4e41
+14 -5
View File
@@ -203,14 +203,23 @@ fi
section "Frontend & Styling: TailwindCSS usage"
# GUIDELINE: Always use TailwindCSS classes for all styling
# REQUIREMENT: Use local builds, not CDN (production-ready, faster, no external dependencies)
echo "Checking for TailwindCSS usage in templates..."
if grep -q "tailwindcss" templates/*.templ 2>/dev/null || grep -q "cdn.tailwindcss.com" templates/*.templ 2>/dev/null; then
success_msg "TailwindCSS is being used in templates"
# Check for CDN usage (violates local-only requirement)
if grep -q "cdn.tailwindcss.com" templates/*.templ 2>/dev/null; then
error_msg "Found TailwindCSS CDN in templates (violation: use local /static/style.css instead)"
grep -n "cdn.tailwindcss.com" templates/*.templ 2>/dev/null
echo "Replace CDN script with: <link href=\"/static/style.css\" rel=\"stylesheet\">"
else
# Check for local build
if grep -q "/static/style.css" templates/*.templ 2>/dev/null; then
success_msg "TailwindCSS local build is being used in templates (correct approach)"
else
warning_msg "TailwindCSS not found in templates (custom CSS may be excessive)"
echo "Expected patterns in templates:"
echo "- tailwindcss in script src or href"
echo "- cdn.tailwindcss.com in script tags"
echo "Expected pattern in templates:"
echo "- <link href=\"/static/style.css\" rel=\"stylesheet\">"
fi
fi
###############################################################################