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

> On the general question of how the Popup API will support animations, please see https://github.com/openui/open-ui/issues/335, and in particular, this comment https://github.com/openui/open-ui/issues/335#issuecomment-1130572590. TL;DR, the Popup API will have a two-stage update for show/hide, which will allow animations to run after adding, or before removing, a popup from the top layer. As you mentioned, that means :top-layer will match during the transition. But that's actually the point - it is very ergonomic:

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. 

> Certainly just going with :popup-open achieves all of the use cases for the popup API. However, the resolution (https://github.com/w3c/csswg-drafts/issues/6965#issuecomment-1118033655) for :modal seems to indicate that CSSWG prefers to have more general pseudo classes for concepts. This would be exactly the opposite conclusion.

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.

`: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).

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


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

Received on Thursday, 2 June 2022 05:29:04 UTC