docs: add exception for inline CSS in error template

Allow inline CSS in templates/error.templ since error pages must work
when the main app fails (404, server errors, CSS fails to load).
This commit is contained in:
2026-02-20 13:26:40 -05:00
parent 0c515a277c
commit 4988eb8b27
2 changed files with 6 additions and 4 deletions
+4 -3
View File
@@ -79,13 +79,14 @@ fi
section "Frontend & Styling: No custom CSS (use TailwindCSS)"
# GUIDELINE: NEVER use custom CSS - TailwindCSS classes only
# EXCEPTION: templates/error.templ is allowed to have inline CSS for error pages (must work when main app fails)
echo "Checking for custom CSS in templates (should use TailwindCSS)..."
STYLE_COUNT=$(grep -l '<style>' templates/*.templ 2>/dev/null | wc -l)
STYLE_COUNT=$(grep -l '<style>' templates/*.templ 2>/dev/null | grep -v 'templates/error.templ' | wc -l)
if [ "$STYLE_COUNT" -gt 0 ]; then
error_msg "Found $STYLE_COUNT templates with <style> tags (violation: custom CSS prohibited)"
grep -l '<style>' templates/*.templ 2>/dev/null | head -10
grep -l '<style>' templates/*.templ 2>/dev/null | grep -v 'templates/error.templ' | head -10
else
success_msg "No custom CSS in templates (TailwindCSS only)"
success_msg "No custom CSS in templates (TailwindCSS only, error.templ excluded)"
fi
# GUIDELINE: NEVER use JavaScript - convert all to TypeScript