[csswg-drafts] [selector-4] Do we need selector for `is` attribute?

hax has just created a new issue for https://github.com/w3c/csswg-drafts:

== [selector-4] Do we need selector for `is` attribute? ==
Currently we have to use `element[is=custom-name]` which have different specificity with `custom-element`. It also means `li[is=my-li]` have higher specificity than `ol > li` which may not meet what dev's want.

I guess the specificity for `is` selector may be 0, or 0.1 😝 which means `x` < `x:is(extends-x)` < `x y`

To be honest, I'm not sure whether we really need `is` attr selector, it could be postpone to selector-5 or further, until we have much real world experiences on custom elements. But, unfortunately recent renaming from `:matches()` to `:is()` have conflict with the `:is()` for `is` attr selector, see https://github.com/w3c/csswg-drafts/issues/3258#issuecomment-439006553 , so we'd better discuss it now.

To solve the syntax conflict, we can:
1. rename (again 😜) `:is`, for example `:any`
2. use non-pseudo-class syntax for `is` selector, for example `x!extends-x`

Or, if we have confidence that we do not need `is` attr selector at all, then no problem 😅



Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3327 using your GitHub account

Received on Friday, 16 November 2018 05:33:29 UTC