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
cssflexboxlayoutsimplicity
Prefer flex layout over height calc() hacks for fixed-header scroll regions
Use a flex column with flex:1 on the scrollable region instead of calc()-based fixed heights and extra height props.
PR: hegnar-components · org-mining-deep-2026-06Created: Jun 17, 2026
Bad example
Old codecss
| 1 | .list { height: calc(100% - 90px); overflow-y: auto; } /* brittle magic 90px */ |
Explanation (EN)
Objašnjenje (HR)
Good example
New codecss
| 1 | .container { display: flex; flex-direction: column; height: 100%; } |
| 2 | .list { flex: 1; overflow-y: auto; } /* no magic number */ |
Explanation (EN)
Objašnjenje (HR)