Comments (3)
在写样式引用antd的less变量的时候,最好是在*.less文件中使用,因为在webpack配置中src/assets/theme/var.less
已经默认全局使用了@import "~antd/lib/style/themes/default.less";
from react-ant-admin.
在写样式引用antd的less变量的时候,最好是在*.less文件中使用,因为在webpack配置中
src/assets/theme/var.less
已经默认使用了@import "~antd/lib/style/themes/default.less";
多谢解答!在var.less中定义的less变量可以在全局使用,但是无法动态修改;stylesDir这个属性意思是自定义样式目录的路径
但是也没通过less.modifyVars修改
这个是如何做到全局修改的呢
from react-ant-admin.
如果你使用 主题色模式(npm run color *)
,如果修改了var.less
的less变量
,需要重启项目才可生效,stylesDir
属性是在启动的时候,去这个文件夹找less文件
,把less变量
替换成真正的值。
主题色配置是在项目启动时
开始去替换一些less变量,并非是在webpack钩子函数
中去热更新替换。因为在之前开发的时候使用antd-theme-generator,webpack去热更新的时候出现项目卡死,所以就没使用热更新less变量,如果你有好的方案,欢迎pr
from react-ant-admin.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-ant-admin.