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
stylingdesign-tokenscolorsmui
Set colors via color props and a colors token object, not CSS classes
Apply text and stroke colors through the component's color prop using values from the shared colors object rather than ad hoc classNames or literals.
PR: hegnar-forum-web · org-mining-hist-2026-06Created: Jun 20, 2026
Bad example
Old codetsx
| 1 | <Typography className={styles.whiteText}>Save</Typography> |
| 2 | <Icon stroke="#ffffff" /> |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | <Typography color={colors.white}>Save</Typography> |
| 2 | <Icon stroke={colors.white} /> |
Explanation (EN)
Objašnjenje (HR)