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
csssvgcomponentsencapsulation
Color icons via a fill prop instead of CSS path targeting
Prefer passing fill/color to an icon component over writing CSS that reaches into its internal <path> elements.
PR: hegnar-zephr-components · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codecss
| 1 | .icon.validated path { fill: $green-600; } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | <Icon fill={isValid ? green : grey} /> |
Explanation (EN)
Objašnjenje (HR)