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
cssmedia-queriesdry
Nest media queries inside the selector to avoid repeating it
Modern CSS allows nested @media; place the query inside the rule so you don't restate the selector.
PR: hegnar-bellsheep-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codecss
| 1 | .card { padding: 8px; } |
| 2 | @media (min-width: 768px) { .card { padding: 16px; } } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codecss
| 1 | .card { |
| 2 | padding: 8px; |
| 3 | @media (min-width: 768px) { padding: 16px; } |
| 4 | } |
Explanation (EN)
Objašnjenje (HR)