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 / Tailwind
cssflexboxiconslayout
Add flex-shrink-0 to icons/avatars so flex doesn't squish them
Fixed-size icons and avatars inside a flex row can get compressed. Apply flex-shrink-0 (shrink-0) so they keep their dimensions.
PR: hegnar-bellsheep-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetsx
| 1 | <div className="flex"><Icon className="h-12 w-12" /><span>{text}</span></div> |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | <div className="flex"><Icon className="h-12 w-12 shrink-0" /><span>{text}</span></div> |
Explanation (EN)
Objašnjenje (HR)