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
cssdryhovercleanliness
On hover/state changes, override only the properties that change
When a state variant differs by a single property (e.g. border color), set just that property instead of re-declaring the whole shorthand.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codescss
| 1 | &:hover::after { |
| 2 | border-right: 2px solid color(brown); |
| 3 | border-bottom: 2px solid color(brown); |
| 4 | } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codescss
| 1 | &:hover::after { |
| 2 | border-right-color: color(brown); |
| 3 | border-bottom-color: color(brown); |
| 4 | } |
Explanation (EN)
Objašnjenje (HR)