Hacker News new | ask | show | jobs
by Bockit 4003 days ago
I prefer to colocate into 1 folder. index.jsx, index[.css,.styl,.scss, etc.]

Just like my JS requires different JS files, my CSS imports various files too. The preprocessor turns that into 1 css file (or n, if you want).

1 comments

Right, so it's more based on "what feels right"? (I don't mean that in a bad way - sorry - am genuinely curious.) Note that you can import files in JS too. If you want to turn it into n files, then there's webpack's code splitting, which makes even more sense here.
More that I don't have to force everything into a single file. I think it's more flexible that way. Let's say one day I work static files into my build process I could chuck them into the same folder where they're relevant to the component.