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: Greg Whitworth via GitHub <sysbot+gh@w3.org>
Date: Fri, 22 Sep 2017 16:08:37 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-331490311-1506096506-sysbot+gh@w3.org>
@FremyCompany and I spoke about this at length, walked through a few different scenarios and the design of `when()` or `is()` is growing on me. With that said, the issue that @dansajin pointed out is a similar annoyance to me. One thing that I noted to @FremyCompany is that you may, say as an author want your entire stylesheet to have 0 specificity so you need to have this selector on every one. We realized that sass solves this problem but that's cumbersome, IMO. 

I'm not saying I have the perfect solution here, but what about an at-rule that within any selector gets the same treatment as `when()` or `is()`. This allows for not repeating the function - as well as allowing for something like `@no-specificity { }` or similar to explain what is occurring since `when()` is essentially combining a filter and nullifying specificity. One downside from this approach (I'm sure people will find others) is that if you only want one selector such as the example above `input:when([disabled])` you'd have an additional lines of code due to using an at-rule while `when()` would be concise.

-- 
GitHub Notification of comment by gregwhitworth
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1170#issuecomment-331490311 using your GitHub account
Received on Friday, 22 September 2017 16:08:29 UTC

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