
GITHUB . COM {
}
Detected CMS Systems:
- Wordpress (2 occurrences)
Title:
[selectors] Functional pseudo-class like :matches() with 0 specificity Β· Issue #1170 Β· w3c/csswg-drafts
Description:
The problem Sometimes, specificity is a blessing. However, more often than not, it gets in the way, and authors have to resort to hacks in order to artificially adjust specificity, such as repeating classes (.foo.foo.foo), turning id sel...
Website Age:
17 years and 8 months (reg. 2007-10-09).
Matching Content Categories {π}
- Cryptocurrency
- Social Networks
- DIY & Home Improvement
Content Management System {π}
What CMS is github.com built with?
Github.com is powered by WORDPRESS.
Traffic Estimate {π}
What is the average monthly size of github.com audience?
ππ Tremendous Traffic: 10M - 20M visitors per month
Based on our best estimate, this website will receive around 10,000,019 visitors per month in the current month.
However, some sources were not loaded, we suggest to reload the page to get complete results.
check SE Ranking
check Ahrefs
check Similarweb
check Ubersuggest
check Semrush
How Does Github.com Make Money? {πΈ}
Subscription Packages {π³}
We've located a dedicated page on github.com that might include details about subscription plans or recurring payments. We identified it based on the word pricing in one of its internal links. Below, you'll find additional estimates for its monthly recurring revenues.How Much Does Github.com Make? {π°}
Subscription Packages {π³}
Prices on github.com are in US Dollars ($).
They range from $4.00/month to $21.00/month.
We estimate that the site has approximately 4,989,889 paying customers.
The estimated monthly recurring revenue (MRR) is $20,957,532.
The estimated annual recurring revenues (ARR) are $251,490,385.
Wordpress Themes and Plugins {π¨}
What WordPress theme does this site use?
It is strange but we were not able to detect any theme on the page.
What WordPress plugins does this website use?
It is strange but we were not able to detect any plugins on the page.
Keywords {π}
specificity, selectors, leaverou, selector, commented, author, override, matches, authors, styles, react, level, layer, member, issue, default, current, layers, single, stylesheet, work, pseudoclass, hacks, specific, edited, selenit, kizu, sign, code, functional, rules, good, cascade, write, rule, control, tabatkins, similar, css, simple, dont, edits, wanted, idea, projects, problem, order, common, makes, div,
Topics {βοΈ}
kizu edits member philipwalton edits member ditch selectors altogether build complex selectors pseudo-class authoring ui libraries unset flex-direction significant semantic differences type projects single class selector handle things similar current specificity hacks [data-size=small] turning id selectors artificially adjust specificity avoid specificity woes artificially increase specificity current author' unsupported css features separating big chunks comment metadata assignees full complex selector full compound selector independent layers similar override flex-direction solve specificity hacks deduce rule priority form input[disabled] projects milestone default mavo stylesheet single class pseudo-classes default author author intent end author author css author rule add single-argument default specificity rules content basically allowing authors attribute selectors css selectors 4 similar idea global context manage current level main idea work properly avoid verbosity
Payment Methods {π}
- Braintree
Questions {β}
- A new pseudo-class (name TBB, perhaps :filter()?
- Already have an account?
- And, yes, the idea is still raw, and if there is interest we can discuss it in a new issue I guess?
- Below I'd briefly write what I managed to come up with, if that sounds good and there is interest for something like that or at least for discussion, I could create a new issue for it maybe (for [css-cascade] probably?
- Do we want to stick with this "something that makes its contents specificity-0", or try and generalize this to solve specificity hacks more generally?
- However, I wonder if it would be better to add single-argument :is() to level 4 and extend to allow for a second argument in Level 5?
- Maybe it could be useful as a reference?
- What about something that just turns off specificity at the stylesheet level, and for those stylesheets everything is order based?
- What's wrong with WebKit's implementation of :matches()?
Schema {πΊοΈ}
DiscussionForumPosting:
context:https://schema.org
headline:[selectors] Functional pseudo-class like :matches() with 0 specificity
articleBody:## The problem
Sometimes, specificity is a blessing. However, more often than not, it gets in the way, and authors have to resort to [hacks in order to artificially adjust specificity](https://csswizardry.com/2014/07/hacks-for-dealing-with-specificity/), such as repeating classes (`.foo.foo.foo`), turning id selectors to attribute selectors (`[id=foo]` instead of `#foo`), or adding pointless `:not()`s (e.g. `.foo:not(.enough):not(.specificity)`).
A common example where specificity goes against author intent is `:not()`. The default specificity rules on `:not()` are almost never helpful. One often includes lots of filters, one after the other, but that increases specificity and makes these rules hard to override. E.g. good luck overriding `div:not(#foo):not(#bar):not(#baz)` in a sane way, even though this selector is essentially as general as `div` minus three specific divs.
In the last few years, it has even become common to avoid selector logic altogether, just to avoid specificity woes. This is basically what conventions like [BEM](http://getbem.com/) are all about: turning combinators and pseudo-classes into a single class selector so that every selector has the same specificity and the cascade only goes top to bottom. For example, authors would write `.form__input--disabled` instead of `form input[disabled]`.
Specificity becomes an even bigger problem when authoring UI libraries, where you want your styles to be easy to override by the end author without them having to keep up with your stylesheet, but you still want to provide sensible defaults. The [default Mavo stylesheet](https://github.com/mavoweb/mavo/blob/master/src-css/mavo.scss) has many good examples of this. It's a stylesheet that's meant to be easy to override, and in practice, authors have to artificially increase specificity of their rules to override it because I had to be very conservative in what is styled so the selectors have to be very specific. However, being specific doesn't always mean they are high priority.
All in all, specificity is a heuristic. It's assuming that it can deduce rule priority from the selection logic, but the selector is not really expressing priority, it's expressing a query. Heuristics are very helpful when they are correct, but a PITA when they fail, so there always needs to be a way to override them. Especially in this case, **specificity is a heuristic that fails so often that many authors have decided the benefit they get from selectors is not worth the specificity trouble and prefer to ditch selectors altogether** and just use classes + JS for the querying logic!
## Proposed solution
A new pseudo-class (name TBB, perhaps `:filter()`?) that works exactly like `:matches()` but with zero specificity. That way, authors have control over the specificity of their rules, and can choose what is best for their use case.
Or, even `:matches()` itself, since it has not yet been implemented, and changing its specificity would solve #1027 at once.
_Edited on Sep 15 to add `:filter()` and some more thoughts_
author:
url:https://github.com/LeaVerou
type:Person
name:LeaVerou
datePublished:2017-04-05T00:33:32.000Z
interactionStatistic:
type:InteractionCounter
interactionType:https://schema.org/CommentAction
userInteractionCount:50
url:https://github.com/1170/csswg-drafts/issues/1170
context:https://schema.org
headline:[selectors] Functional pseudo-class like :matches() with 0 specificity
articleBody:## The problem
Sometimes, specificity is a blessing. However, more often than not, it gets in the way, and authors have to resort to [hacks in order to artificially adjust specificity](https://csswizardry.com/2014/07/hacks-for-dealing-with-specificity/), such as repeating classes (`.foo.foo.foo`), turning id selectors to attribute selectors (`[id=foo]` instead of `#foo`), or adding pointless `:not()`s (e.g. `.foo:not(.enough):not(.specificity)`).
A common example where specificity goes against author intent is `:not()`. The default specificity rules on `:not()` are almost never helpful. One often includes lots of filters, one after the other, but that increases specificity and makes these rules hard to override. E.g. good luck overriding `div:not(#foo):not(#bar):not(#baz)` in a sane way, even though this selector is essentially as general as `div` minus three specific divs.
In the last few years, it has even become common to avoid selector logic altogether, just to avoid specificity woes. This is basically what conventions like [BEM](http://getbem.com/) are all about: turning combinators and pseudo-classes into a single class selector so that every selector has the same specificity and the cascade only goes top to bottom. For example, authors would write `.form__input--disabled` instead of `form input[disabled]`.
Specificity becomes an even bigger problem when authoring UI libraries, where you want your styles to be easy to override by the end author without them having to keep up with your stylesheet, but you still want to provide sensible defaults. The [default Mavo stylesheet](https://github.com/mavoweb/mavo/blob/master/src-css/mavo.scss) has many good examples of this. It's a stylesheet that's meant to be easy to override, and in practice, authors have to artificially increase specificity of their rules to override it because I had to be very conservative in what is styled so the selectors have to be very specific. However, being specific doesn't always mean they are high priority.
All in all, specificity is a heuristic. It's assuming that it can deduce rule priority from the selection logic, but the selector is not really expressing priority, it's expressing a query. Heuristics are very helpful when they are correct, but a PITA when they fail, so there always needs to be a way to override them. Especially in this case, **specificity is a heuristic that fails so often that many authors have decided the benefit they get from selectors is not worth the specificity trouble and prefer to ditch selectors altogether** and just use classes + JS for the querying logic!
## Proposed solution
A new pseudo-class (name TBB, perhaps `:filter()`?) that works exactly like `:matches()` but with zero specificity. That way, authors have control over the specificity of their rules, and can choose what is best for their use case.
Or, even `:matches()` itself, since it has not yet been implemented, and changing its specificity would solve #1027 at once.
_Edited on Sep 15 to add `:filter()` and some more thoughts_
author:
url:https://github.com/LeaVerou
type:Person
name:LeaVerou
datePublished:2017-04-05T00:33:32.000Z
interactionStatistic:
type:InteractionCounter
interactionType:https://schema.org/CommentAction
userInteractionCount:50
url:https://github.com/1170/csswg-drafts/issues/1170
Person:
url:https://github.com/LeaVerou
name:LeaVerou
url:https://github.com/LeaVerou
name:LeaVerou
InteractionCounter:
interactionType:https://schema.org/CommentAction
userInteractionCount:50
interactionType:https://schema.org/CommentAction
userInteractionCount:50
External Links {π}(7)
- Find out how much https://github.blog earns monthly
- Profit of https://csswizardry.com/2014/07/hacks-for-dealing-with-specificity/
- How much does http://getbem.com/ pull in monthly?
- https://webkit.org/blog/3615/css-selectors-inside-selectors-discover-matches-not-and-nth-child/'s total income per month
- How much does http://kizu.ru/en/fun/controlling-the-specificity/ pull in?
- How much revenue does https://drafts.csswg.org/css-cascade/#origin produce monthly?
- What are the total earnings of https://www.githubstatus.com/?
Analytics and Tracking {π}
- Site Verification - Google
Libraries {π}
- Clipboard.js
- D3.js
- Lodash
Emails and Hosting {βοΈ}
Mail Servers:
- aspmx.l.google.com
- alt1.aspmx.l.google.com
- alt2.aspmx.l.google.com
- alt3.aspmx.l.google.com
- alt4.aspmx.l.google.com
Name Servers:
- dns1.p08.nsone.net
- dns2.p08.nsone.net
- dns3.p08.nsone.net
- dns4.p08.nsone.net
- ns-1283.awsdns-32.org
- ns-1707.awsdns-21.co.uk
- ns-421.awsdns-52.com
- ns-520.awsdns-01.net