gpt4 book ai didi

webpack - antd 自定义原色

转载 作者:行者123 更新时间:2023-12-05 00:48:44 25 4
gpt4 key购买 nike

我正在使用 antd 和 create-react-app 来创建我的应用程序。

我遵循这个例子:https://github.com/ant-design/antd-init/tree/master/examples/customize-antd-theme

Here they have given example using webconfig. When i tried to replacete the same i m unable to change the primary color. Can anybody tell how to do the same in create-react-app ?

最佳答案

如果你不想使用 react-scripts 弹出您可以简单地创建一个 less 文件(比如说 main.less ),导入 antd.less 并在这个 main.less 文件中替换 ant design 的默认变量。

使用lessc (npm i -g less) 编译这个less 文件。

lessc "main.less antd.css"--js--js 用于 less 中的内联 javascript 现在只需在您的应用中包含这些已编译的 css。

查看 https://medium.com/@aksteps/782c53cbc03b完整的演练

关于webpack - antd 自定义原色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48883724/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com