Skip to content

[css-contain] Stacking Context is undesired #10300

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
FirstVertex opened this issue May 9, 2024 · 1 comment
Closed

[css-contain] Stacking Context is undesired #10300

FirstVertex opened this issue May 9, 2024 · 1 comment

Comments

@FirstVertex
Copy link

FirstVertex commented May 9, 2024

https://www.w3.org/TR/css-contain-3/

@container queries create a new stacking context. This is 100% undesired. Media queries do not work like that. All my z-index are fubar after trying to use @container queries. There is no logical relationship between the container size (dimensions) and the stacking order (z-index). Marking an element as a container should not ever influence the stacking context. Css @container queries are useless in their current state because of this extra stacking context which adds nothing but extra problems and quirks. Please delete the part of container queries which makes a new stacking context so that container queries can actually be used.

See Also
https://stackoverflow.com/questions/76607899/why-does-container-type-inline-size-seem-to-mess-with-stacking-overflow-rules

https://stackoverflow.com/questions/76237217/how-can-i-position-z-indexed-contained-within-css-containers-used-for-container

@mirisuzanne
Copy link
Contributor

mirisuzanne commented Feb 20, 2025

I believe this has been fixed by #10544 - and appears to behave correctly in recent versions of Chrome and Firefox (looks like I need an upgrade to test the latest Safari):

See https://codepen.io/miriamsuzanne/pen/pvoyNOE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants