The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Only load css that is actually needed Re: Only load css that is actually needed

Kitty Giraudel

If no mistake, having a 20Ko CSS file (minified/gzipped) is better than having 2* 6-8Ko CSS file (resulting in 12 to 16Ko of CSS).

What is costly is not parsing CSS, it’s doing a HTTP request. So I’d probably go with only one file minified and gzipped. If your CSS is clean, the parsing will be fast, then it’s browser cached anyway.

If you want to manage different files in production to ease the development, then use a pre-processor like LESS, Sass or whatever and their clean @import function.