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:
@@ -26,12 +26,13 @@
|
|||||||
### Frontend & Styling
|
### Frontend & Styling
|
||||||
- ❌ **NEVER modify backend/API for frontend features without user confirmation**
|
- ❌ **NEVER modify backend/API for frontend features without user confirmation**
|
||||||
- ❌ **NEVER use custom CSS** - TailwindCSS classes only
|
- ❌ **NEVER use custom CSS** - TailwindCSS classes only
|
||||||
|
- **⚠️ EXCEPTION**: `templates/error.templ` may have inline CSS because error pages must work when main app fails (404, server errors, CSS fails to load)
|
||||||
- ❌ **NEVER use JavaScript** - convert all to TypeScript
|
- ❌ **NEVER use JavaScript** - convert all to TypeScript
|
||||||
- ❌ **NEVER use Object-Oriented Programming** (no classes, inheritance, or this-capture)
|
- ❌ **NEVER use Object-Oriented Programming** (no classes, inheritance, or this-capture)
|
||||||
- ✅ **DO use procedural/imperative style** as your default
|
- ✅ **DO use procedural/imperative style** as your default
|
||||||
- ✅ **DO borrow functional techniques** when they simplify code
|
- ✅ **DO borrow functional techniques** when they simplify code
|
||||||
- ✅ **DO avoid ideological purity** - the best paradigm is the one that fits the problem
|
- ✅ **DO avoid ideological purity** - the best paradigm is the one that fits the problem
|
||||||
- ❌ **NEVER add new Dockerfiles without user confirmation
|
- ❌ **NEVER add new Dockerfiles without user confirmation**
|
||||||
- ❌ **NEVER fetch initial data via AJAX on page load** - use server-side rendering instead
|
- ❌ **NEVER fetch initial data via AJAX on page load** - use server-side rendering instead
|
||||||
- ❌ **NEVER break progressive enhancement** - pages must work without JavaScript
|
- ❌ **NEVER break progressive enhancement** - pages must work without JavaScript
|
||||||
|
|
||||||
|
|||||||
@@ -79,13 +79,14 @@ fi
|
|||||||
section "Frontend & Styling: No custom CSS (use TailwindCSS)"
|
section "Frontend & Styling: No custom CSS (use TailwindCSS)"
|
||||||
|
|
||||||
# GUIDELINE: NEVER use custom CSS - TailwindCSS classes only
|
# 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)..."
|
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
|
if [ "$STYLE_COUNT" -gt 0 ]; then
|
||||||
error_msg "Found $STYLE_COUNT templates with <style> tags (violation: custom CSS prohibited)"
|
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
|
else
|
||||||
success_msg "No custom CSS in templates (TailwindCSS only)"
|
success_msg "No custom CSS in templates (TailwindCSS only, error.templ excluded)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# GUIDELINE: NEVER use JavaScript - convert all to TypeScript
|
# GUIDELINE: NEVER use JavaScript - convert all to TypeScript
|
||||||
|
|||||||
Reference in New Issue
Block a user