antd-theme-generator icon indicating copy to clipboard operation
antd-theme-generator copied to clipboard

我使用组件遇到自定义样式被覆盖的情况,原因是老项目有定制样式,而克隆出来的antd样式覆盖了原样式

Open reai99 opened this issue 2 years ago • 1 comments

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

reai99 avatar Oct 19 '22 06:10 reai99

可以使用如下正则,移除没有变量的静态antd样式,这样静态的antd样式不会把原来的样式覆盖掉 css = css.replace(/^.+?\w+[^{]+{[^@={}]+}$/gm, '');

reai99 avatar Oct 26 '22 14:10 reai99