Closed itayganor closed 2 years ago
This plugin can not work with CSS modules, because it assumes that elements in different themes use the same class name, so the style can be changed with the switch of the theme files in real time, but in CSS modules each class name will be compiled into a unique name. If you already use CSS modules, then I think you can switch between themes by importing different theme files and state management without using this plugin.
For future googlers: Since asking this I have made a Webpack plugin that supports switching themes while working with CSS Modules.
In my project, I use CSS classnames as such:
configured on webpack as:
And it seems
themes-switch
are not able to keep that generated classnames (by CSS Modules) when generating themes.Is there any way to make it work?
I don't think it should be complicated; the
localIdentName
should be considered when reading the file content.