我正在尝试将 Craco 与 Ant-Design 一起使用,但我无法制作合适的主题切换器。有没有更简单的方法来为此实现主题切换器?
const CracoLessPlugin = require("craco-less");
const {
getThemeVariables
} = require('antd/dist/theme');
module.exports = {
plugins: [{
plugin: CracoLessPlugin,
options: {
lessLoaderOptions: {
lessOptions: {
modifyVars: {
"@primary-color": "#1DA57A",
...getThemeVariables({
dark: true,
compact: true
})
},
javascriptEnabled: true
}
}
}
}],
};