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
cssz-indexstackinglayering
Keep z-index values low and lean on DOM order for stacking
Don't escalate z-index (9999) to win stacking battles. Among equal z-index, later DOM elements stack on top, so reorder markup or use small values; keep a handful of defined layers.
PR: hegnar-bellsheep-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codecss
| 1 | .popover { z-index: 9999999999; } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codecss
| 1 | .popover { z-index: 10; } /* and rely on DOM order / a small layer scale */ |
Explanation (EN)
Objašnjenje (HR)