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 ruleP1stack specificStack: css
csslayoutoverflowresponsive
Avoid 100vw for full-width; prefer container query units
100vw ignores the scrollbar and can cause horizontal overflow; make the element's ancestor a container and use 100cqi/100cqw instead.
PR: hegnar-web · org-mining-2026-06Created: Jun 17, 2026
Bad example
Old codecss
| 1 | .feature { width: 100vw; } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codecss
| 1 | html { container-type: inline-size; } |
| 2 | .feature { width: 100cqw; } /* respects scrollbar, no overflow */ |
Explanation (EN)
Objašnjenje (HR)