mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-25 03:29:59 +08:00
docs: 📝 fix create-react-app step (#24227)
This commit is contained in:
parent
f45f7353a5
commit
c99ecdac39
@ -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,
|
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
|
```diff
|
||||||
|
/* src/App.ts */
|
||||||
|
- import './App.css';
|
||||||
|
+ import './App.less';
|
||||||
|
```
|
||||||
|
|
||||||
|
```diff
|
||||||
|
/* src/App.less */
|
||||||
- @import '~antd/dist/antd.css';
|
- @import '~antd/dist/antd.css';
|
||||||
+ @import '~antd/dist/antd.less';
|
+ @import '~antd/dist/antd.less';
|
||||||
```
|
```
|
||||||
|
@ -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 样式和修改变量。
|
按照 [配置主题](/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
|
```diff
|
||||||
|
/* src/App.ts */
|
||||||
|
- import './App.css';
|
||||||
|
+ import './App.less';
|
||||||
|
```
|
||||||
|
|
||||||
|
```diff
|
||||||
|
/* src/App.less */
|
||||||
- @import '~antd/dist/antd.css';
|
- @import '~antd/dist/antd.css';
|
||||||
+ @import '~antd/dist/antd.less';
|
+ @import '~antd/dist/antd.less';
|
||||||
```
|
```
|
||||||
|
@ -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,
|
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
|
```diff
|
||||||
|
/* src/App.js */
|
||||||
|
- import './App.css';
|
||||||
|
+ import './App.less';
|
||||||
|
```
|
||||||
|
|
||||||
|
```diff
|
||||||
|
/* src/App.less */
|
||||||
- @import '~antd/dist/antd.css';
|
- @import '~antd/dist/antd.css';
|
||||||
+ @import '~antd/dist/antd.less';
|
+ @import '~antd/dist/antd.less';
|
||||||
```
|
```
|
||||||
|
@ -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 样式和修改变量。
|
按照 [配置主题](/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
|
```diff
|
||||||
|
/* src/App.js */
|
||||||
|
- import './App.css';
|
||||||
|
+ import './App.less';
|
||||||
|
```
|
||||||
|
|
||||||
|
```diff
|
||||||
|
/* src/App.less */
|
||||||
- @import '~antd/dist/antd.css';
|
- @import '~antd/dist/antd.css';
|
||||||
+ @import '~antd/dist/antd.less';
|
+ @import '~antd/dist/antd.less';
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user