pro-components icon indicating copy to clipboard operation
pro-components copied to clipboard

🧐[问题] colorPrimary setting drawer

Open hmz22 opened this issue 2 years ago • 1 comments

🧐 问题描述

when change color primary on setting drawer not effect and my all Component just blue primary color. what wrong my code?

💻 示例代码

https://codesandbox.io/s/ji-chu-shi-yong-forked-cdskzs?file=/App.tsx

🚑 其他信息

"antd": "^4.24.1", "@ant-design/pro-card": "^2.0.23", "@ant-design/pro-components": "^2.3.29", "@ant-design/pro-layout": "^7.2.0",

hmz22 avatar Nov 07 '22 12:11 hmz22

'root-entry-name': 'variable',我记着webpack配置需注入less变量,你试试

buquan avatar Nov 08 '22 01:11 buquan

I use vite react can tell me how add this in vite? For now i used import 'antd/dist/antd.variable.min.css css and use ConfigProvider.config({ theme: { primaryColor: '#25b864', },

hmz22 avatar Nov 08 '22 19:11 hmz22

preprocessor0ptions:{	
less:{	
modifyVars:{	
'root-entry-name': 'variable',
}}}

You can try in vite.config

buquan avatar Nov 08 '22 23:11 buquan

After this I most delete import 'antd/dist/antd.variable.min.css And

ConfigProvider.config({
theme: {
primaryColor: '#25b864',
}})

???

hmz22 avatar Nov 09 '22 06:11 hmz22

all remain you can read docs https://ant.design/docs/react/customize-theme-variable-cn#header

buquan avatar Nov 09 '22 06:11 buquan

I add this code to vite and fixed also no need import css and ConfigProvider.config. thx.

hmz22 avatar Nov 11 '22 07:11 hmz22