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
reactsvgassetsperformance
Render SVGs as components instead of CSS background-image where possible
Inline SVGs as React components rather than CSS background-image so the framework can optimize and control them; CSS backgrounds are acceptable only for tiny static cases.
PR: hegnar-forum-web · org-mining-hist-2026-06Created: Jun 20, 2026
Bad example
Old codescss
| 1 | .label::after { |
| 2 | content: ''; |
| 3 | background-image: url('data:image/svg+xml;...'); |
| 4 | } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | <span className="label"> |
| 2 | {text} |
| 3 | <Icon /> |
| 4 | </span> |
Explanation (EN)
Objašnjenje (HR)