Rules Hub
Code Ruleset
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
frontend ruleP2universalStack: CSS
cssfontsfallbacktypography
Always provide a generic font-family fallback
End a custom font stack with an appropriate generic family, such as sans-serif, serif or monospace, to define the fallback explicitly.
PR: hegnar-zephr-components · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codecss
| 1 | .name { font-family: 'Inter'; } |
Explanation (EN)
An unspecified fallback can produce unsuitable typography when the custom font is unavailable.
Objašnjenje (HR)
Good example
New codecss
| 1 | .name { font-family: 'Inter', sans-serif; } |
Explanation (EN)
Objašnjenje (HR)
Notes (EN)
For a custom font stack, provide a generic fallback matching the intended typography and test loading/failure layout.
Exceptions / Tradeoffs (EN)
Use serif, monospace or another appropriate generic family when sans-serif is not the intended fallback.