3 ms·
If you condense everything that can be condensed, the resulting style sheet could be harder to adapt to changing requirements. One example of this is when some
by kazinator 9y ago
If you condense everything that can be condensed, the resulting style sheet could be harder to adapt to changing requirements.
One example of this is when some styles are "accidentally" the same for two elements. If you condense them into one rule, then you lose the independent control.
"Hey look, 97% of the users always turn up bass and treble together and turn down the middrange; we can condense the three-band equalizer panel down to one knob!"
- moosingin3space 9y agoThis is why I personally like the Vue/React way of scoped CSS -- it promotes loading a simple baseline CSS (like Skeleton) for the full page and specializing in the individual component layer. It's easy to refactor in the case of changing requirements (if the same across components, move style into global CSS, if not, move into component).
- jorblumesea 9y agoShout to React's Styled Components: https://github.com/styled-components/styled-components https://github.com/styled-components/styled-components Very nice to work with.
- specialist 9y agoThe pitfall of using HTML+CSS for content generation/authoring, instead of as a page description output format.
- HugoDaniel 9y agoTry an atomic CSS approach. Its clean, its minimal, it works. :) http://tachyons.io/ http://tachyons.io/