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
stylingmuicssconsistency
Avoid the sx prop for static styling; use component props or a CSS module
Treat the sx prop as a last resort: express static styles as component props first, then a CSS module, and reserve sx for cases neither can cover.
PR: vinify-frontend · org-mining-2026-06Created: Jun 17, 2026
Bad example
Old codetsx
| 1 | <Box sx={{ marginTop: 2, borderRight: '1px solid #ccc' }} /> |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | <Box mt={2} className={styles.box} /> // props first, scss for the rest |
Explanation (EN)
Objašnjenje (HR)