forked from umijs/umi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
197 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,32 @@ | ||
--- | ||
id: theme | ||
title: 主题配色 | ||
title: 定制主题 | ||
--- | ||
|
||
主题配色。 | ||
我们支持通过 [modifyVars](http://lesscss.org/usage/#using-less-in-the-browser-modify-variables) 的方式来覆盖变量。 | ||
|
||
## 通过 theme 属性定制主题 | ||
|
||
新建 .webpackrc,.webpackrc 文件用于配置 webpack,内容如下: | ||
|
||
```json | ||
{ | ||
"theme": { | ||
"primary-color": "#7546c9" | ||
} | ||
} | ||
``` | ||
|
||
本地开发服务器会自动重启, | ||
|
||
<img src="https://gw.alipayobjects.com/zos/rmsportal/YMdGEpszmHZcUfcYBRWO.png" width="450" height="414" style="margin-left:0;" /> | ||
|
||
然后,效果如下: | ||
|
||
<img src="https://gw.alipayobjects.com/zos/rmsportal/qGncpVZOUmhbcxbvihRW.png" width="450" height="414" style="margin-left:0;" /> | ||
|
||
## 参考 | ||
|
||
* https://ant.design/docs/react/customize-theme-cn | ||
* [antd 的默认样式变量](https://github.com/ant-design/ant-design/blob/master/components/style/themes/default.less) | ||
* [antd-mobile 的默认样式变量](https://github.com/ant-design/ant-design-mobile/blob/master/components/style/themes/default.less) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters