W3C home > Mailing lists > Public > public-css-archive@w3.org > September 2017

Re: [csswg-drafts] [selectors] Functional pseudo-class like :matches() with 0 specificity

From: Marc Robichaud via GitHub <sysbot+gh@w3.org>
Date: Fri, 15 Sep 2017 19:18:57 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-329875704-1505503126-sysbot+gh@w3.org>
I have a component with a lot of states, but I want to have a single class. I do this with data attributes now, but it increases specificity. Currently it's something like this (Suggest naming this :is)...

```css
.button {
    ...styles 

    &:is([data-size=small]) {
        ...styles
    } 
    &:is(:focus) {
        ...styles
    }
    &:is([disabled]) {
        ...styles
    }
    &:is([data-selected]) {
        ...styles
    } 
}
```

-- 
GitHub Notification of comment by studiosciences
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1170#issuecomment-329875704 using your GitHub account
Received on Friday, 15 September 2017 19:18:50 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:18 UTC