Browse Source

docs: update customize theme docs (#23159)

pull/23162/head
zefeng 5 years ago
committed by GitHub
parent
commit
5999aa7414
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      docs/react/customize-theme.en-US.md
  2. 2
      docs/react/customize-theme.zh-CN.md

2
docs/react/customize-theme.en-US.md

@ -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');
@ -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,
+ },

2
docs/react/customize-theme.zh-CN.md

@ -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');
@ -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,
+ },

Loading…
Cancel
Save