Re: [csswg-drafts] [selectors] Add :modal-dialog pseudo-class (#6965)

My issue with `:modal` is still that it feels like we're overly genericizing from too few examples. As Mason said above, the use-case we're being driven by is "a dialog opened modally". The precise definition of what "modal" means outside of this use-case is up for debate, and we don't have any further use-cases driving the definition, so we'd be making arbitrary "seems right" judgements. These'll matter *today*, since as demonstrated above, fullscreen elements *might* qualify, depending on your precise definition.

If we go with `:modal` and then get this definition *wrong*, in the future when we realize it's wrong and have some new thing that's "modal" but doesn't match our definition, we might be screwed. If we still want a nice generic name, too bad, it's been claimed.  On the other hand, if we go with `:modal-dialog`, and in the future realize we have several "modal" things that would be *useful* to address as a group, we can add `:modal` *then* and just pay the cost of a redundant `:modal-dialog` still hanging around.

We've done this sort of early-genericizing before, and sometimes we get it right, while other times we regret it and either have to do some painful definition-changing or just use a less-good name for the better thing we realize we need.  In this case I don't feel there's a strong argument that we're getting it right, and I'd *much* rather pay the pain of a redundant overly-specific pseudo-class sticking around, than the pain of having a generic-sounding-but-actually-just-for-dialogs pseudoclass and then a worse name for the actual generic pseudoclass.

Pair all of this with @tantek's argument that when we have only one example of a supposedly-generic pseudoclass, authors *will* write selectors using the pseudoclass on its own and assume it'll only apply to this one situation, providing possible compat pain in the future when we want to add it to a second thing.

So, we should name it `:modal-dialog` and make it only apply to modal dialogs. We can add `:modal` in the future if/when it proves useful.

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


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

Received on Wednesday, 27 April 2022 20:30:15 UTC