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
csslayoutmaintainability
Avoid magic spacing values; use layout properties that adapt
Don't pin elements with hardcoded paddings/offsets that break when surrounding sizes change; prefer flexbox alignment, percentages, or anchoring (right: 0) so layout stays correct when paddings or container sizes change.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codecss
| 1 | .timeOfDayContainer { padding-top: rem-calc(10); } |
| 2 | .x::after { right: rem-calc(175); } // breaks at other resolutions |
Explanation (EN)
Objašnjenje (HR)
Good example
New codecss
| 1 | .buttonsContainer { align-items: center; } |
| 2 | .x::after { right: 0; } // anchored |
Explanation (EN)
Objašnjenje (HR)