Skip to content

Commit c4c75ba

Browse files
committed
docs: update customize theme docs
1 parent 27357d5 commit c4c75ba

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

docs/vue/customize-theme.en-US.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ module.exports = {
120120
Another approach to customize theme is creating a `less` file within variables to override `antd.less`.
121121

122122
```css
123-
@import "~antd/dist/antd.less"; // Import Ant Design styles by less entry
123+
@import "~ant-design-vue/dist/antd.less"; // Import Ant Design Vue styles by less entry
124124
@import "your-theme-file.less"; // variables to override above
125125
```
126126

@@ -138,9 +138,9 @@ While there's no canonical way to do it, you can take one of the following paths
138138
It's possible to configure webpack to load an alternate less file:
139139

140140
```ts
141-
new webpack.NormalModuleReplacementPlugin( /node_modules\/antd\/lib\/style\/index\.less/, path.resolve(rootDir, 'src/myStylesReplacement.less') )
141+
new webpack.NormalModuleReplacementPlugin( /node_modules\/ant-design-vue\/lib\/style\/index\.less/, path.resolve(rootDir, 'src/myStylesReplacement.less') )
142142

143-
#antd { @import '~antd/lib/style/core/index.less'; @import '~antd/lib/style/themes/default.less'; }
143+
#antd { @import '~ant-design-vue/lib/style/core/index.less'; @import '~ant-design-vue/lib/style/themes/default.less'; }
144144
```
145145

146146
Where the src/myStylesReplacement.less file loads the same files as the index.less file, but loads them within the scope of a top-level selector : the result is that all of the "global" styles are being applied with the #antd scope.
@@ -154,7 +154,7 @@ See an example of usage with gulp and [postcss-prefixwrap](https://github.com/db
154154
You must import styles as less format. A common mistake would be importing multiple copied of styles that some of them are css format to override the less styles.
155155

156156
- If you import styles by specifying the `style` option of [babel-plugin-import](https://github.com/ant-design/babel-plugin-import), change it from `'css'` to `true`, which will import the `less` version of antd.
157-
- If you import styles from `'antd/dist/antd.css'`, change it to `antd/dist/antd.less`.
157+
- If you import styles from `'ant-design-vue/dist/antd.css'`, change it to `ant-design-vue/dist/antd.less`.
158158

159159
## Related Articles
160160

docs/vue/customize-theme.zh-CN.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ module.exports = {
122122
另外一种方式是建立一个单独的 `less` 变量文件,引入这个文件覆盖 `antd.less` 里的变量。
123123

124124
```css
125-
@import "~antd/dist/antd.less"; // 引入官方提供的 less 样式入口文件
125+
@import "~ant-design-vue/dist/antd.less"; // 引入官方提供的 less 样式入口文件
126126
@import "your-theme-file.less"; // 用于覆盖上面定义的变量
127127
```
128128

@@ -133,7 +133,7 @@ module.exports = {
133133
注意样式必须加载 less 格式,一个常见的问题就是引入了多份样式,less 的样式被 css 的样式覆盖了。
134134

135135
- 如果你在使用 [babel-plugin-import](https://github.com/ant-design/babel-plugin-import) 的 `style` 配置来引入样式,需要将配置值从 `'css'` 改为 `true`,这样会引入 less 文件。
136-
- 如果你是通过 `'antd/dist/antd.css'` 引入样式的,改为 `antd/dist/antd.less`。
136+
- 如果你是通过 `'ant-design-vue/dist/antd.css'` 引入样式的,改为 `ant-design-vue/dist/antd.less`。
137137

138138
## 社区教程 for Antd React
139139

0 commit comments

Comments
 (0)