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
magic-numberscopy-pastereadabilitybreakpoints
Do not copy magic values or their comments into unrelated contexts
A constant or breakpoint justified in one file is meaningless when pasted elsewhere; derive or reference a real value for the new context.
PR: hegnar-components · org-mining-deep-2026-06Created: Jun 17, 2026
Bad example
Old codecss
| 1 | // Got this value by calculating the minimal width necessary for desktop view not to break |
| 2 | @media (min-width: 712px) { ... } // copied from another component |
Explanation (EN)
Objašnjenje (HR)
Good example
New codecss
| 1 | // Use a named, shared breakpoint that has meaning here |
| 2 | @media (min-width: $sm) { ... } |
Explanation (EN)
Objašnjenje (HR)