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 ruleP2universalStack: CSS/SCSS
cssresponsivebreakpointscorrectness
Subtract 1px from the breakpoint when using max-width
A breakpoint at 768px means max-width queries should target 767px; using max-width: 768px inadvertently creates a new 769px breakpoint.
PR: hegnar-components · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codescss
| 1 | @media (max-width: 768px) { /* overlaps with the 768px min-width side */ } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codescss
| 1 | @media (max-width: 767px) { /* breakpoint is 768px, so max stops at 767px */ } |
Explanation (EN)
Objašnjenje (HR)