dynamic-theme-demos
dynamic-theme-demos copied to clipboard
Can't switch between themes when arbitraryMode = true
Hello, is it possible to switch between themes when arbitraryMode = true
?
When running the "webpack-react-antd-dynamic-theme" demo in this repo, I noticed that when arbitraryMode = true
is set in the config of ThemeCssExtractWebpackPlugin
, the html
tag does not contain theme info like class="theme-mauve"
, and I cannot switch between the themes defined in multipleScopeVars
array.
When I comment out arbitraryMode = true
, then the themes are working but now I cannot set arbitrary theme color.
getDynamicThemePluginConfig.js
const multipleScopeVars = [
{
// 必需
scopeName: "theme-mauve",
// path和varsContent选一个
path: path.resolve("src/theme/mauve-vars.less"),
// varsContent:`@--color-primary:#9c26b;`
},
{
scopeName: 'theme-second',
path: path.resolve('src/theme/second-vars.less'),
}
];
// ...
new ThemeCssExtractWebpackPlugin({
// 以下是任意主题模式的参数 arbitraryMode:true 有效
// arbitraryMode: true,
// ...
})
Any help is appreciated, thank you.
Preset mode and any mode cannot coexist now.