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
csstransitioncorrectnessnitpick
Transition only the property that actually changes
Set the CSS transition to the property being animated (e.g. color) rather than an unrelated one like background-color.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codescss
| 1 | .item:hover .title { |
| 2 | color: var(--red); |
| 3 | transition: background-color .2s ease-in-out, color .2s ease-in-out; |
| 4 | } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codescss
| 1 | .item:hover .title { |
| 2 | color: var(--red); |
| 3 | transition: color $global-animation-duration; |
| 4 | } |
Explanation (EN)
Objašnjenje (HR)