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
cssspacingresponsiveux
Add inherent spacing around content so it never hits container edges
Give content (images, error states) some padding/margin so on short or narrow viewports it doesn't touch the borders. Match spacing patterns already used elsewhere for consistency.
PR: hegnar-bellsheep-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetsx
| 1 | <div className="flex items-center justify-center"><img src={error} /></div> // hits edges |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | <div className="flex items-center justify-center px-6 py-12"><img src={error} /></div> |
Explanation (EN)
Objašnjenje (HR)