docs: 📝 fix create-react-app step (#24227)

This commit is contained in:
偏右 2020-05-17 22:47:14 +08:00 committed by GitHub
parent f45f7353a5
commit c99ecdac39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 4 deletions

View File

@ -109,9 +109,16 @@ module.exports = {
According to the [Customize Theme documentation](/docs/react/customize-theme), we need to modify less variables via loader like [less-loader](https://github.com/webpack/less-loader). We can use [craco-less](https://github.com/DocSpring/craco-less) to achieve that,
First we should import less other then css.
First we should modify `src/App.css` to `src/App.less`, then import less file instead.
```diff
/* src/App.ts */
- import './App.css';
+ import './App.less';
```
```diff
/* src/App.less */
- @import '~antd/dist/antd.css';
+ @import '~antd/dist/antd.less';
```

View File

@ -107,9 +107,16 @@ module.exports = {
按照 [配置主题](/docs/react/customize-theme) 的要求,自定义主题需要用到类似 [less-loader](https://github.com/webpack-contrib/less-loader/) 提供的 less 变量覆盖功能。我们可以引入 [craco-less](https://github.com/DocSpring/craco-less) 来帮助加载 less 样式和修改变量。
首先修改样式引用为 less 文件。
首先`src/App.css` 文件修改为 `src/App.less`,然后修改样式引用为 less 文件。
```diff
/* src/App.ts */
- import './App.css';
+ import './App.less';
```
```diff
/* src/App.less */
- @import '~antd/dist/antd.css';
+ @import '~antd/dist/antd.less';
```

View File

@ -117,9 +117,16 @@ module.exports = {
According to the [Customize Theme documentation](/docs/react/customize-theme), we need to modify less variables via loader like [less-loader](https://github.com/webpack/less-loader). We can use [craco-less](https://github.com/DocSpring/craco-less) to achieve that,
First we should import less other then css.
First we should modify `src/App.css` to `src/App.less`, then import less file instead.
```diff
/* src/App.js */
- import './App.css';
+ import './App.less';
```
```diff
/* src/App.less */
- @import '~antd/dist/antd.css';
+ @import '~antd/dist/antd.less';
```

View File

@ -119,9 +119,16 @@ module.exports = {
按照 [配置主题](/docs/react/customize-theme) 的要求,自定义主题需要用到类似 [less-loader](https://github.com/webpack-contrib/less-loader/) 提供的 less 变量覆盖功能。我们可以引入 [craco-less](https://github.com/DocSpring/craco-less) 来帮助加载 less 样式和修改变量。
首先修改样式引用为 less 文件。
首先`src/App.css` 文件修改为 `src/App.less`,然后修改样式引用为 less 文件。
```diff
/* src/App.js */
- import './App.css';
+ import './App.less';
```
```diff
/* src/App.less */
- @import '~antd/dist/antd.css';
+ @import '~antd/dist/antd.less';
```