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 set both a fixed width and a max-width that conflicts
Simplify redundant sizing constraints after checking actual computed and responsive behavior; fixed width and responsive caps are different contracts.
Bad example
| 1 | .popover { width: 280px; max-width: 280px; } |
Explanation (EN)
Equal fixed width and max-width can repeat the same cap when no other constraint relies on it.
Objašnjenje (HR)
Good example
| 1 | .popover { width: 280px; } |
Explanation (EN)
This preserves the fixed-size contract when the equal max-width is proven redundant; a responsive redesign needs its own validation.
Objašnjenje (HR)
Notes (EN)
For literal width/max-width declarations under the same condition, compare their effective constraints and responsive intent before removing one.
Exceptions / Tradeoffs (EN)
width:100% with max-width can shrink with its container; replacing a fixed width with it changes behavior. Different units, min-width, box sizing and breakpoint overrides can make both constraints meaningful.