We are building a large site which requires very modular CSS. The problem we have is that we like using the @import statement as it’s very clean, but the major downside is the performance (all CSS files referenced are loaded synchronously i.e. not in parallel).
Does anyone know of a way to use PHP (or even .htaccess) to find any CSS files referenced via @import and then generate a single CSS file?
I’ve looked at loads of examples (some of which are seen here): http://robertnyman.com/2010/01/19/tools-for-concatenating-and-minifying-css-and-javascript-files-in-different-development-environments/ but none of them work with @import.
Thanks.
Less can do that: http://lesscss.org/#-importing
Maybe sass also, but I’m not sure