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
cssinline-stylesspecificitymaintainability
Prefer CSS classes over inline styles
Apply styling through classes rather than inline style props. Inline styles have high specificity that's hard to override later and scatter presentation across the component tree; keep them to a minimum.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codejsx
| 1 | <div style={{ position: 'relative' }}>{children}</div> |
Explanation (EN)
Objašnjenje (HR)
Good example
New codejsx
| 1 | <div className="position-relative">{children}</div> |
Explanation (EN)
Objašnjenje (HR)