Rules Hub
Code Ruleset
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
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.
Bad example
| 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)
A copied explanation may describe another component and provide false confidence in this value.
Objašnjenje (HR)
Good example
| 1 | // Use a named, shared breakpoint that has meaning here |
| 2 | @media (min-width: $sm) { ... } |
Explanation (EN)
Objašnjenje (HR)
Notes (EN)
Derive a breakpoint/offset from this component's actual layout requirement or reuse a shared token only when it expresses the same constraint.
Exceptions / Tradeoffs (EN)
A content-driven local breakpoint can be more correct than an unrelated global breakpoint; do not replace a measured value just to use a token.