Rules Hub
Code Ruleset
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
Remove CSS properties made redundant by the layout model in use
Remove layout declarations proven ineffective in the actual formatting context; do not assume block display makes explicit width redundant.
Bad example
| 1 | .row { display: flex; } |
| 2 | .row > .item { float: left; } |
Explanation (EN)
A float on a flex item has no layout effect, whereas width changes require their own layout proof.
Objašnjenje (HR)
Good example
| 1 | .row { display: flex; } |
Explanation (EN)
The parent flex layout already governs its direct items.
Objašnjenje (HR)
Notes (EN)
Remove a CSS declaration only after verifying the element role, computed layout and cascade across relevant states. For float, distinguish a flex item from a flex container.
Exceptions / Tradeoffs (EN)
display:block does not make width:100% redundant on inputs or replaced elements. Padding, margins and box-sizing can distinguish auto from 100%. A flex container itself may still float.