3 ms·
Dumb Q: if you split them as in the example at the end of the article... then you have a lot of duplicated rules obviously as 90% of your CSS _should_ be the sa
by keyle 4y ago
Dumb Q: if you split them as in the example at the end of the article... then you have a lot of duplicated rules obviously as 90% of your CSS _should_ be the same?
Maybe the example at the end wasn't clear enough that you should still have a base CSS that encompasses the common parts?
- gnabgib 4y agoIt looks like Patrick is proposing the `default.css` holds most of the CSS (the 90% you're talking of), with mobile/tablet/desktop/print holding only variances over those base settings (so they'd only be the further 10% and only one downloaded matching the media definition.. maybe two if you print preview)
- httpsterio 4y agoIn reality, your css file size is most likely not going to be any type of bottle neck in website performance anyways. In my experience, browser side javascript is always the biggest render blocking issue with all the on-the-fly dom manipulation it might entail. Viewport specific css usually adds some kilobytes, a few hundred at most but the browser tends to be relatively swift about those as long as you don't use a lot of stuff like transitions or wildcard selectors on a broad spectrum.