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
responsivemedia-queriesdrymarkup
Use one markup with CSS/media queries instead of duplicating markup per breakpoint
When mobile and desktop share the same structure, render it once and adapt with media queries rather than maintaining separate mobile and desktop markup.
PR: hegnar-web · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codetsx
| 1 | <div className="desktop-only"><Header /></div> |
| 2 | <div className="mobile-only"><Header /></div> |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | <Header /> // single instance; layout adjusted via media queries in CSS |
Explanation (EN)
Objašnjenje (HR)