React template css modules


#1

Hi!

Maybe I’m mistaken but it looks like css modules are enabled in the react template. How can I accomplish this with sass? I tried

const cssOptions = { minimize: false, modules: true };

but then it seems that the .sass modules are not being translated correctly, which makes sense because the class names are all mangled now.

Thanks


#2

I don’t use css-modules in the template. There is also no explicit dependency defined in the package.json. Maybe it comes as a peer dependency. But I don’t have it enabled explicitly.


#3

Thanks akkie. I learned you can enable it by simply passing modules:true into css Options in neutrino-sass.js. Although it does require you to go through all the components and refactor import ./...scss to import x from ./...scss and then reference like x.name_of_class when doing className=.... Might be an improvement as it can help avoid collision.