Rules Hub
Coding Rules Library
← 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 ruleP1universalStack: css
cssaccessibilityi18ncontent
Keep user-facing text in markup, not in CSS content properties
Put visible labels and text in the template/JSX so it is searchable, translatable, and accessible, rather than injecting it via the CSS content property.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codecss
| 1 | .adLabel > div::before { |
| 2 | content: 'Annonse:'; |
| 3 | } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | <span className={styles.adLabel}>Annonse:</span> |
Explanation (EN)
Objašnjenje (HR)