[csswg-drafts] [selectors] Multi-value attribute selectors (#6042)

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

== [selectors] Multi-value attribute selectors ==
Spec: [Selectors](https://drafts.csswg.org/selectors-4/#attribute-selectors)

When styling text fields, there are many attribute values to be listed. I’m wondering could there be a syntax for listing multiple attribute values without repeating the attribute name. It could look something like this:

```css
input:not([type=button, checkbox, color, file, hidden, image, radio, range, reset, submit])
```

which would equal the following:
```css
input:not([type=button], [type=checkbox], [type=color], [type=file], [type=hidden],
          [type=image], [type=radio], [type=range], [type=reset], [type=submit])
```

For this specific use case, a pseudo-class like `:text-input` may be better, because listing input types is error prone and a particular input type may be be a text field or not depending on the browser and OS (for example `date` is a text field in major desktop browsers but a button in Chrome for Android). But there may be other use cases for attribute value lists.

(The original idea is not mine, but I can’t find the comment where this idea was mentioned.)

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


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

Received on Friday, 26 February 2021 23:51:49 UTC