Hacker News new | ask | show | jobs
by cheald 5696 days ago
My experience has been the opposite - stylesheets get smaller, because there's less repetition and fewer wasted styles. CSS has a really nasty habit of ballooning over time into an unholy tarpit of selectors and overrides and exceptions, especially when you're working with multiple people in the code.

Any bloat caused by the more verbose selectors seems to be easily offset by the lack of repetition, and the maintenance is orders of magnitude easier to manage. At the end of the day, you're still talking about maybe a couple of extra kb, which ends up being a negligible number of bytes post-gzip. In exchange, you get massively easier-to-manage stylesheets and a whole lot less developer time spent to make things happen.

Over the past couple of weeks, I've been refactoring a very large stylesheet with SASS.

  Original size: 138.8k (gz: 23.5k, 16.9% original size)
  Sass-generated size: 105.9k (gz: 18.2k, 17.1% original size)
Very, very easily worth the transition, and as a bonus, the stylesheet is factored into a bunch of partials, each relevant to different parts of the site, so when I want to tweak something in comments, I just open _comments.sass and hack there, rather than trying to find the right section in a monolithic stylesheet.