Skip to content

Commit

Permalink
docs: update customize theme docs (ant-design#23159)
Browse files Browse the repository at this point in the history
  • Loading branch information
AshoneA authored Apr 12, 2020
1 parent 89ce33f commit 5999aa7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/react/customize-theme.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ If the project does not use Less, you can import [antd.dark.css](https://unpkg.c
Method 3: using [less-loader](https://github.com/webpack-contrib/less-loader) in `webpack.config.js` to introduce as needed:

```diff
const defaultTheme = require('antd/dist/default-theme');
const darkTheme = require('antd/dist/dark-theme');
const compactTheme = require('antd/dist/compact-theme');

Expand All @@ -198,6 +199,7 @@ module.exports = {
+ options: {
+ modifyVars: {
+ 'hack': `true;@import "${require.resolve('antd/lib/style/color/colorPalette.less')}";`,
+ ...defaultTheme, // darkTheme and compactTheme depend on defaultTheme
+ ...darkTheme,
+ ...compactTheme,
+ },
Expand Down
2 changes: 2 additions & 0 deletions docs/react/customize-theme.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ module.exports = {
方式三:是用在 `webpack.config.js` 使用 [less-loader](https://github.com/webpack-contrib/less-loader) 按需引入:

```diff
const defaultTheme = require('antd/dist/default-theme');
const darkTheme = require('antd/dist/dark-theme');
const compactTheme = require('antd/dist/compact-theme');

Expand All @@ -176,6 +177,7 @@ module.exports = {
+ options: {
+ modifyVars: {
+ 'hack': `true;@import "${require.resolve('antd/lib/style/color/colorPalette.less')}";`,
+ ...defaultTheme, // darkTheme 和 compactTheme 依赖 defaultTheme
+ ...darkTheme,
+ ...compactTheme,
+ },
Expand Down

0 comments on commit 5999aa7

Please sign in to comment.