-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Recommended example for :backdrop #75
Comments
One solution to keep the backdrop beneath everything, is to use ::backdrop, body:has(.\:popover-open)::before {
z-index: 1;
content: '';
width: 100%;
height: 100%;
position: fixed;
left: 0;
top: 0;
background: #0004;
backdrop-filter: blur(2px);
}
.\:popover-open {
z-index: 2;
}
[popup]:popover-open {
z-index: 2;
} |
@mirisuzanne @keithamus What do you think about this? Seems related to #130 |
I agree these are the same issue - so we could close the newer one as a duplicate. Overall, I think it's a good idea to provide a solution here. I'd have to play around with the different options to know what solution I like best. It seems to me like providing an additional wrapping element might be the most robust solution? |
I closed the newer issue. @mirisuzanne Is this something you'd have time to look at? Or maybe @stacyk? |
Looking again, I think the body:has() trick from @joshnuss is pretty promising. Could simplify a bit, maybe:
I don't think we need the But someone should probably test that. |
If we don't want to require |
Another solution for avoiding |
I've tried implementing this on a large application and ran into all sorts of issues with z-index, positioning and overflow, it works perfectly in isolation but the TopLayer breaks free of constraints natively however even though the backdrop works, the popover is still bound by surrounding elements and their styles in the DOM. |
Hey 👋
Might be cool to have some kind of support for
:backdrop
behavior or a heads-up on how you might implement that yourself.Could be in something like:
Although using the pseudoelement runs into the issue of getting the
:backdrop
beneath the content. Might be nice to give some kind of guided snippet for those wanting that behavior 👍@jh3y
The text was updated successfully, but these errors were encountered: