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 ruleP1universalStack: CSS
cssresponsivebreakpointscorrectness
Apply a style only at the breakpoints where it has an effect
Scope properties like z-index or positioning to the breakpoint where they actually matter, instead of applying them globally and breaking smaller viewports.
PR: hegnar-zephr-components · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codecss
| 1 | /* applied at all sizes, but only needed on desktop, and breaks mobile */ |
| 2 | .searchResults { width: 504px; top: 100%; z-index: 50; } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codecss
| 1 | .searchResults { /* mobile defaults */ } |
| 2 | @media (min-width: 1024px) { |
| 3 | .searchResults { width: 504px; z-index: 50; } |
| 4 | } |
Explanation (EN)
Objašnjenje (HR)