vbenjs / vite-plugin-theme

Vite plugin for dynamically changing the theme color of the interface
MIT License
140 stars 35 forks source link

组件内部样式无法提取 #1

Closed cjSound closed 3 years ago

cjSound commented 3 years ago

例如 Ant Design Vue 的样式变量 @success-color: #52c41a; // 成功色

在系统中定义如下样式,此颜色为antd vue 系统默认成功颜色

image

修改主题颜色示例如下

image

系统内部颜色修改达到预期,但是antd组件内部样式没有改变 ,如下

image

组件是进度条,组件内部的样式还是原生样式,在app-theme-style.css没有提取到对应的颜色 求指教,这块要怎么解决还是调用方式不对 @anncwb

anncwb commented 3 years ago

最近比较忙,我有时间在排查下,或者可以先看下我的另外一个示例项目会不会

cjSound commented 3 years ago

感谢作者回复 换了种调用方式可以找到antd的less依赖了 之前写法是在main.js import 'ant-design-vue/dist/antd.less'; 在调试的时候发现 插件的transform都没有调用adtd.less 而系统中直接引入的less,依赖倒是可以找到 再将antd.less移到系统中index.less 中引入,发现依赖找到了,后续正常 具体原因有时间在深究