docs(theme-chalk): update the modification guide introduced by webpack on demand (#6496)

This commit is contained in:
Lay Hunt 2022-03-10 15:42:56 +08:00 committed by GitHub
parent 593082ec65
commit 0d6cfc60b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -161,6 +161,30 @@ export default defineConfig({
})
```
If you are using webpack, and you want to custom theme when importing on demand.
```ts
// webpack.config.ts
// use unplugin-element-plus
import ElementPlus from 'unplugin-element-plus/webpack'
export default defineConfig({
css: {
loaderOptions: {
scss: {
additionalData: `@use "~/styles/element/index.scss" as *;`,
},
},
},
plugins: [
ElementPlus({
useSource: true,
}),
],
})
```
### By CSS Variable
CSS Variables is a very useful feature, already supported by almost all browsers. (IE: Wait?)