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: universal
svgfouclayout-shiftperformance
Set explicit width and height on inline SVGs to prevent layout jumps
Give inline SVG icons explicit width/height so they don't render at huge intrinsic size during the brief window before stylesheets load.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetsx
| 1 | <LogoSvg className={style.logo} /> |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | // width/height prevent the SVG ballooning before CSS loads |
| 2 | <LogoSvg width={'56'} height={'18'} className={style.logo} /> |
Explanation (EN)
Objašnjenje (HR)