Stacking Context
A stacking context is a local group of CSS layers. Items are ordered inside the group first, then the whole group is placed among other groups.
Another example
A modal is inside a transformed card, next to a separate page header. Even z-index: 9999 cannot move the modal outside the card's stacking context. Z-index values compare only inside the context where they belong.
Main parts
- 01context root
- 02local paint order
- 03atomic sibling order
Use it when
Use this term to explain why one overlapping child cannot rise above an item in another layer group.
Do not use it when
Do not treat the whole page as one z-index scale or add huge values before finding the context roots.
Name used in code
context root → local paint order → atomic sibling Before you ship
Check content order, shared design values, component consistency, contrast, zoom, and layout changes by screen size. Verify every theme, language, and state. If there is motion, offer an equal reduced-motion experience.
Outcome: Use or define Stacking Context to make the visual experience clear and easy to use. User context: A modal is inside a transformed card, next to a separate page header. Even z-index: 9999 cannot move the modal outside the card's stacking context. Z-index values compare only inside the context where they belong. Design concept to apply: Stacking Context. Why it fits: Use this term to explain why one overlapping child cannot rise above an item in another layer group. Do not use it when: Do not treat the whole page as one z-index scale or add huge values before finding the context roots. Design requirements: Set the content order, shared design values, and reusable components. Define how the layout changes by screen size and state. Keep useful design choices separate from decoration. Inclusion and resilience: Check contrast, zoom, languages, themes, and reduced motion when needed. Do not use color or effects as the only way to show meaning. Acceptance criteria: The design stays clear on phones and desktops, at zoom, in every theme, and in all supported languages. Interactive states stay clear and consistent. Evidence and limits (evidence boundary): A formal document may still be a draft, release candidate, or final version. Check its status and browser or platform support. Unknowns to confirm: Brand limits, amount of content, supported themes and languages, target devices, and design-system rules.
Check this request
Review the current use of Stacking Context. Definition: A stacking context is a local group of CSS layers. Items are ordered inside the group first, then the whole group is placed among other groups. Release checks: Check content order, shared design values, component consistency, contrast, zoom, and layout changes by screen size. Verify every theme, language, and state. If there is motion, offer an equal reduced-motion experience. Before changing code, report the evidence you found, gaps, severity, and the smallest safe fix.