Discussion:
Repetition in style sheets
(too old to reply)
Jens Oliver Meiert
2017-06-01 16:13:36 UTC
Permalink
Raw Message
FYI, I ran a little study about the DRYness of large-scale style
sheets and our situation there, and found a what I deem excessive
amount of declaration repetition (and repetition in general):
https://meiert.com/en/blog/20170531/70-percent-css-repetition/ (data:
https://docs.google.com/spreadsheets/d/1c-Xan1pkBvlmtRRnlj4WAI_KvTZp9znHhjkZue2HlY4/edit#).

Maybe this of interest for the group; I believe that not only is there
much potential when it comes to style sheet optimization (something we
might be able to do more about), but also that there are more lessons
to be learned from particularly large sites.

Best,

Jens.
--
Jens Oliver Meiert
https://meiert.com/en/

✎ On Web Development: https://meiert.com/webdev
Tab Atkins Jr.
2017-06-01 18:33:27 UTC
Permalink
Raw Message
Post by Jens Oliver Meiert
FYI, I ran a little study about the DRYness of large-scale style
sheets and our situation there, and found a what I deem excessive
https://docs.google.com/spreadsheets/d/1c-Xan1pkBvlmtRRnlj4WAI_KvTZp9znHhjkZue2HlY4/edit#).
Maybe this of interest for the group; I believe that not only is there
much potential when it comes to style sheet optimization (something we
might be able to do more about), but also that there are more lessons
to be learned from particularly large sites.
Yup, this seems to match what a number of other people in the
CSS-processing community have found, which is that "atomizing" a
stylesheet into its component declarations can offer significant space
savings. It doesn't seem to match people's preferred authoring styles
/ mental models, but as a post-processing step it seems to have a lot
of promise.

~TJ
David Woolley
2017-06-01 19:42:16 UTC
Permalink
Raw Message
Post by Tab Atkins Jr.
It doesn't seem to match people's preferred authoring styles
/ mental models
I think most web designers are visual people, not language people, so
they don't encode the deep structure of the design, just whether a
particular bit of text is a particular colour, etc. CSS works better if
you think deeper about the structure. Most designers would probably be
happy with everything inline.
Jens Oliver Meiert
2017-06-02 14:14:46 UTC
Permalink
Raw Message
I think most web designers are visual people, not language people, so they
don't encode the deep structure of the design, just whether a particular bit
of text is a particular colour, etc. CSS works better if you think deeper
about the structure. Most designers would probably be happy with
everything inline.
More of a tangent I suppose but I find we’ve gone through some
interesting changes, in that the cost of violating orthogonality has
gone down quite a bit. Viz., inlining (but also what’s called atomic
now) would have caused massive maintenance troubles in the past,
whereas now these have become much less of a burden (and cost).
Personally I still prefer and recommend strict separation of concerns
(and with that, continued use of functional ID and class names) but
the whole debate has changed.

(Incidentally, I’m currently surveying what makes for good
maintainability with https://goo.gl/77NDre.)
--
Jens Oliver Meiert
https://meiert.com/en/
Marat Tanalin
2017-06-01 18:40:31 UTC
Permalink
Raw Message
Post by Jens Oliver Meiert
FYI, I ran a little study about the DRYness of large-scale style
sheets and our situation there, and found a what I deem excessive
amount of declaration repetition (and repetition in general)
Fwiw, ability to nest rules and use mixins like it's possible with preprocessors would probably be crucial for making stylesheets much more DRY.
Loading...