Re: [csswg-drafts] [selectors] Add `:top-layer` pseudo class (#7319)

> Your comment seems to suggest otherwise, `:top-layer` doesn't match during the closing transition, even though the popup is still in the top layer when closing. I think it makes sense for ergonomics, but also is wrong in terms of when the `:top-layer` pseudo class matches.

Right - for the ergonomics to work, I think `:top-layer` can't match during show/hide animations, during which the element is still actually in the top layer, but is in the process of animating in or out. That's how the transitions are triggered. I'm open to suggestions here. What's the use case that would break as a result of this "mismatch" during transitions? Do you have suggestions for how to make it cleaner?


> I wasn't necessarily fond of the `:modal` pseudo in the first place (there's still the issue behind it of "what is modal?" or "is fullscreen modal?"), but anyway a modal dialog is a semantic concept well understood by web developers. The top layer is a presentational concept not necessarily well understood, which is the main issue to me.
> 
> > I'm very open to suggestions for a better name.

I'm still very open to suggestions for a better (general-purpose) name.

> `:popup-open` or just `:open` seemed like a better name to me, it is quite straightforward to understand. If consistency is an issue, `dialog[open]` could also be matched to `dialog:open` (which is useful for dialogs not in the top layer, e.g. non-modal ones).

At OpenUI we discussed `:open` but decided against it because it was a bit confusing in several cases. See the comments and discussion starting here https://github.com/openui/open-ui/issues/470#issuecomment-1099537467.

We can certainly go back to `:popup-open`, defined for the Popup API only. It just doesn't line up with the resolution for `:modal`, which is general purpose. If folks are happy with that asymmetry, ok by me.

-- 
GitHub Notification of comment by mfreed7
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7319#issuecomment-1146353959 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 3 June 2022 20:53:55 UTC