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 ruleP2universalStack: css
cssnamingdesign-tokensmaintainability
Name design tokens by semantic role, not by literal value
Name shared variables after what they mean (disabled-text, brand-primary), not their raw value (beige-13), so changing one usage does not silently affect unrelated ones.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codescss
| 1 | $beige-13: #716d62; |
| 2 | .button-disabled { color: $beige-13; } |
| 3 | .footer-note { color: $beige-13; } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codescss
| 1 | $text-disabled: #716d62; |
| 2 | .button-disabled { color: $text-disabled; } |
| 3 | // footer-note keeps its own semantic token if its meaning differs |
Explanation (EN)
Objašnjenje (HR)