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 ruleP2stack specificStack: react
stylingspacingmuidesign-system
Use the theme spacing scale instead of hardcoded pixels or rems
For spacing props like gap/margin/padding, use the design system's spacing factor (e.g. MUI's 8px-per-unit scale) rather than hardcoding px/rem values.
PR: vinify-frontend · org-mining-2026-06Created: Jun 17, 2026
Bad example
Old codetsx
| 1 | <Box gap="2px" padding="24px" /> |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | <Box gap={0.25} p={3} /> // 8 * 0.25 = 2px, 8 * 3 = 24px |
Explanation (EN)
Objašnjenje (HR)