You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is part of a series of issues (previous: Color manipulation) about our findings wrt SCSS usage in the wild, as a data-driven way to inform future directions of CSS evolution. While studying CSS usage tells us a lot about what authors are currently doing, preprocessor usage tells us a lot about what authors want to be doing. We studied nearly 300K SCSS stylesheets, extracted from HTTPArchive's corpus of 6 million websites through sourcemaps.
Findings:
Inline if() is the second most used function (after darken()), and accounts for 14.5% of all function calls. It was used 2 million times in our corpus, or an average of 7 times per sheet. We did not measure what percentage of pages it appears on (but we can, if that's of interest) source
SCSS supports block conditionals and loops. Of those, @if is by far most popular, appearing in 63% of SCSS sheets. Out of all control flow blocks, @if accounted for 62% of them. source
Out of the three looping constructs, the simpler @each was by far the most popular, accounting for 31% of all control flow blocks (83% of all looping constructs) and appearing on 54% of sheets. source
We did not measure how many SCSS sheets use mixins overall (we could, upon request), but the number is well above half, since the most popular mixin, clarfix, appears on 52% of sheets. source
Over half of SCSS sheets use custom functions, since the median sheet defines two of them source
Nesting is hugely common. We only looked at explicit nesting, i.e. with the & selector, which is used on 85% of all SCSS sheets. About half of its usage is to set pseudo-class or pseudo-element variants, e.g. &:hover. One quarter of & usage is for classes (e.g. &.foo). Not only is it common across sheets, but it's used very frequently within the same sheet: Out of the 300K SCSS sheets we studied, we found 57 million uses of &, which means it was used about 200 times per sheet on average. source
In terms of relation to existing work, these stats:
This is part of a series of issues (previous: Color manipulation) about our findings wrt SCSS usage in the wild, as a data-driven way to inform future directions of CSS evolution. While studying CSS usage tells us a lot about what authors are currently doing, preprocessor usage tells us a lot about what authors want to be doing. We studied nearly 300K SCSS stylesheets, extracted from HTTPArchive's corpus of 6 million websites through sourcemaps.
Findings:
if()
is the second most used function (afterdarken()
), and accounts for 14.5% of all function calls. It was used 2 million times in our corpus, or an average of 7 times per sheet. We did not measure what percentage of pages it appears on (but we can, if that's of interest) source@if
is by far most popular, appearing in 63% of SCSS sheets. Out of all control flow blocks,@if
accounted for 62% of them. source@each
was by far the most popular, accounting for 31% of all control flow blocks (83% of all looping constructs) and appearing on 54% of sheets. sourceclarfix
, appears on 52% of sheets. source&
selector, which is used on 85% of all SCSS sheets. About half of its usage is to set pseudo-class or pseudo-element variants, e.g.&:hover
. One quarter of&
usage is for classes (e.g.&.foo
). Not only is it common across sheets, but it's used very frequently within the same sheet: Out of the 300K SCSS sheets we studied, we found 57 million uses of&
, which means it was used about 200 times per sheet on average. sourceIn terms of relation to existing work, these stats:
The text was updated successfully, but these errors were encountered: