Hacker News new | ask | show | jobs
by chrisutz 3892 days ago
I think the point the author was trying to make was that you shouldn't split CSS files because the import order on a page influences how its all interpreted; that CSS files are not independent modules and you are kidding yourself in a sense by using multiple files. HTTP/2 will not fix the problem the author was trying to call out, it will just remove the speed penalty.
1 comments

> CSS files are not independent modules

I wholeheartedly disagree. Using Bootstrap, for example, I'm able to remove rules that aren't related to each other by commenting out the import. In fact, I use only 5 of Bootstrap's 15+ LESS files for most projects.

Of course, for the custom CSS for any site that sits on top of Bootstrap, I put that all into one file. But for someone writing all their CSS from scratch, multiple files makes sense. What if you have a huge project that needs everything styled down to the radio buttons, and then you also have a one-pager that only needs a few styles? You'd want to be able to take your existing CSS with you and disable/enable as necessary.