This week, I wrote about using the CSS @import
rule to modularize CSS, and some performance challenges with that approach.
tl;dr: the issue isn't the @import
rule itself, but that files under 1kb often end up the same size or even bigger when gzipped, so you get no compression benefits.
I ran a few additional tests, and wanted to share the data I found.
- 40 modular CSS files
- All imported from a single
kelp.css
file hosted on JSDelivr