Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
AshoneA committed Apr 15, 2020
1 parent 9873dcf commit 93beeba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
12 changes: 3 additions & 9 deletions docs/react/customize-theme.en-US.md
Expand Up @@ -141,9 +141,7 @@ We have some official themes, try them out and give us some feedback!

![](https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*mYU9R4YFxscAAAAAAAAAAABkARQnAQ)

#### Method 1

Using Umi 3.
Method 1: using Umi 3

If you're using [Umi 3](http://umijs.org/zh/), which only need two steps:

Expand All @@ -165,9 +163,7 @@ If you're using [Umi 3](http://umijs.org/zh/), which only need two steps:
},
```

#### Method 2

Import [antd/dist/antd.dark.less](https://unpkg.com/browse/antd@4.x/dist/antd.dark.less) or [antd/dist/antd.compact.less](https://unpkg.com/browse/antd@4.x/dist/antd.compact.less) in the style file:
Method 2: Import [antd/dist/antd.dark.less](https://unpkg.com/browse/antd@4.x/dist/antd.dark.less) or [antd/dist/antd.compact.less](https://unpkg.com/browse/antd@4.x/dist/antd.compact.less) in the style file:

```less
@import '~antd/dist/antd.dark.less'; // Introduce the official dark less style entry file
Expand All @@ -183,9 +179,7 @@ If the project does not use Less, you can import [antd.dark.css](https://unpkg.c

> Note that you don't need to import `antd/dist/antd.less` or `antd/dist/antd.css` anymore, please remove it, and remove babel-plugin-import `style` config too. You can't enable two or more theme at the same time by this method.
#### Method 3

using [less-loader](https://github.com/webpack-contrib/less-loader) in `webpack.config.js` to introduce as needed:
Method 3: using [less-loader](https://github.com/webpack-contrib/less-loader) in `webpack.config.js` to introduce as needed:

```diff
const { getThemeVariables } = require('antd/dist/theme');
Expand Down
12 changes: 3 additions & 9 deletions docs/react/customize-theme.zh-CN.md
Expand Up @@ -119,9 +119,7 @@ module.exports = {

![](https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*mYU9R4YFxscAAAAAAAAAAABkARQnAQ)

#### 方式一

使用 Umi 3
方式一:使用 Umi 3

如果你在使用 [Umi 3](http://umijs.org/zh/),仅需两步:

Expand All @@ -143,9 +141,7 @@ module.exports = {
},
```

#### 方式二

是在样式文件全量引入 [antd.dark.less](https://unpkg.com/browse/antd@4.x/dist/antd.dark.less)[antd.compact.less](https://unpkg.com/browse/antd@4.x/dist/antd.compact.less)
方式二:是在样式文件全量引入 [antd.dark.less](https://unpkg.com/browse/antd@4.x/dist/antd.dark.less)[antd.compact.less](https://unpkg.com/browse/antd@4.x/dist/antd.compact.less)

```less
@import '~antd/dist/antd.dark.less'; // 引入官方提供的暗色 less 样式入口文件
Expand All @@ -161,9 +157,7 @@ module.exports = {

> 注意这种方式下你不需要再引入 `antd/dist/antd.less``antd/dist/antd.css` 了,可以安全移除掉。也不需要开启 babel-plugin-import 的 `style` 配置。通过此方式不能同时配置两种及以上主题。
#### 方式三

是用在 `webpack.config.js` 使用 [less-loader](https://github.com/webpack-contrib/less-loader) 按需引入:
方式三:是用在 `webpack.config.js` 使用 [less-loader](https://github.com/webpack-contrib/less-loader) 按需引入:

```diff
const { getThemeVariables } = require('antd/dist/theme');
Expand Down

0 comments on commit 93beeba

Please sign in to comment.