From 0c5c7e4e41224a2b20f4510061f0bf151eb806ec Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Tue, 3 Feb 2026 09:44:39 -0500 Subject: [PATCH] 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 --- scripts/verify-guidelines.sh | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/scripts/verify-guidelines.sh b/scripts/verify-guidelines.sh index b1dba14..e3eb6c8 100755 --- a/scripts/verify-guidelines.sh +++ b/scripts/verify-guidelines.sh @@ -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: " 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" + # 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 pattern in templates:" + echo "- " + fi fi ###############################################################################