CSS Modules in Meteor

I was working on adding support for CSS Modules in our Meteor app and decided to make a slightly more general blog post on creating compiler plugins in Meteor. It’s “On CSS Modules in Meteor” on my blog and, as usual, I posted it to r/programming and r/meteor for visibility.

Let me know if you find it helpful and whether you’d like to see more texts like this!

10 Likes

Very nice article! I mostly use Vue myself and for me one of the major benefits of it is single file components with scoped CSS. Writing just plain CSS that’s scoped and very close to the markup just feels right :slight_smile:

Hey @radekmie, is it possible for you to post the code for this on your github? There is no expectation for you to maintain this, but some of us would find a lot of value in your code as a starting point :slight_smile:

This was a very fun article to read! Awesome stuff :star_struck:

I decided not to do it because I knew people would expect some maintenance of it. I know it’s not ideal, but you can just copy-paste the code sections as they are – as long as you “merge” the methods (class declaration is duplicated), you’re good to go.

2 Likes

I wish Blaze would allow that as well, makes things so much clearer. I’m pretty sure I have many obsolete lines of CSS in my Frontend app and also contradicting and overruling CSS from my former Dev

Vue’s scoped CSS is nice, I agree. But you can use CSS Modules with Blaze as well. It just takes some more code, as you need to get the import the classes first. (The boilerplate code could be reduced by making a helper for it.)