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 ruleP1universalStack: react
performanceimagesweb-vitalsresponsive
Provide a sizes attribute on responsive images to reduce download weight
Set the sizes attribute on responsive/next-image elements so the browser downloads an appropriately scaled image instead of an oversized one.
PR: hegnar-forum-web · org-mining-2026-06Created: Jun 17, 2026
Bad example
Old codetsx
| 1 | <Image src={src} fill alt="" /> |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | <Image src={src} fill sizes="(max-width: 768px) 100vw, 33vw" alt="" /> |
Explanation (EN)
Objašnjenje (HR)