Hacker News new | ask | show | jobs
by freshyill 4126 days ago
This is pretty interesting because the extends certainly result in DRYer CSS, which I think most of us would have figured to perform better.

I know I've gotten myself into some hairy situations in the past by mistakenly extending things that were already extended, and unintended consequences are a concern even now.

I've got a hefty redesign due to launch in the near future, and I'm doing a lot of performance tuning. I've got ~300 includes (mostly media queries) and ~30 extends. This seems like an easy enough change to make right now for a quick, but small win.

3 comments

> This is pretty interesting because the extends certainly result in DRYer CSS, which I think most of us would have figured to perform better.

I'm not so sure. Matching selectors to the DOM is a time consuming process. So more selectors, more time spent. I think parsing the rules is fast in comparison.

I've heard some horror stories of mistakenly nested extends resulting in CSS files that were in the megabyte+ range at the local Sass meetup. I've shyed away from extends mostly from a sanity perspective as I've found mixins more sane.
@freshyill It sounds like you're on the right track. In way of performance tuning I'd recommend using:

- https://github.com/t32k/stylestats - https://github.com/katiefenn/parker - http://www.webpagetest.org/

Thanks! I hadn't seen stylestats or parker yet.