antd-theme-generator
antd-theme-generator copied to clipboard
我使用组件遇到自定义样式被覆盖的情况,原因是老项目有定制样式,而克隆出来的antd样式覆盖了原样式
Describe the bug 我使用组件遇到自定义样式被覆盖的情况,原因是老项目有定制样式,而克隆出来的antd样式覆盖了原样式
Show your code 可以使用如下组件, 基于antd-theme-generator进行修改,支持对非动态样式就行过滤替换掉,可以使用如下组件 antd-theme-full-generator
Screenshots If applicable, add screenshots to help explain your problem.
Version Which version is installed in your application? Try using the latest version, that may help
可以使用如下正则,移除没有变量的静态antd样式,这样静态的antd样式不会把原来的样式覆盖掉 css = css.replace(/^.+?\w+[^{]+{[^@={}]+}$/gm, '');