Rules Hub
Code Ruleset
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
Don't re-declare a CSS property already set on the element
Remove redundant declarations that duplicate a value already applied (e.g. a transition declared twice on the same rule).
Bad example
| 1 | .btn { |
| 2 | transition: color 0.2s; |
| 3 | /* ... */ |
| 4 | transition: color 0.2s; /* duplicate */ |
| 5 | } |
Explanation (EN)
An identical declaration with no intervening semantic effect adds maintenance noise.
Objašnjenje (HR)
Good example
| 1 | .btn { |
| 2 | transition: color 0.2s; |
| 3 | } |
Explanation (EN)
Objašnjenje (HR)
Notes (EN)
Within the same effective rule and condition, remove a repeated declaration only after checking order, importance, shorthand resets and unsupported-value fallbacks.
Exceptions / Tradeoffs (EN)
Repeated property names with different values may be compatibility fallbacks or intentional overrides. A later duplicate can restore a value reset by an intervening shorthand.