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:
@@ -203,14 +203,23 @@ fi
|
|||||||
section "Frontend & Styling: TailwindCSS usage"
|
section "Frontend & Styling: TailwindCSS usage"
|
||||||
|
|
||||||
# GUIDELINE: Always use TailwindCSS classes for all styling
|
# 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..."
|
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
|
else
|
||||||
warning_msg "TailwindCSS not found in templates (custom CSS may be excessive)"
|
# Check for local build
|
||||||
echo "Expected patterns in templates:"
|
if grep -q "/static/style.css" templates/*.templ 2>/dev/null; then
|
||||||
echo "- tailwindcss in script src or href"
|
success_msg "TailwindCSS local build is being used in templates (correct approach)"
|
||||||
echo "- cdn.tailwindcss.com in script tags"
|
else
|
||||||
|
warning_msg "TailwindCSS not found in templates (custom CSS may be excessive)"
|
||||||
|
echo "Expected pattern in templates:"
|
||||||
|
echo "- <link href=\"/static/style.css\" rel=\"stylesheet\">"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|||||||
Reference in New Issue
Block a user