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.
@import. It wouldn't be too difficult to whip up something that scanned the CSS files and did the concatenation for you as a part of a build process or something (then minified it).@importwithin each file, they'll still load the same way. Instead of relying on the sheets to pull each other in, just pass all the separate sheets to the minify parser.