feat: SCSS变量导出
This commit is contained in:
@@ -19,6 +19,8 @@ $--border-color-lighter: #e6ebf5;
|
||||
|
||||
$--table-border: 1px solid #dfe6ec;
|
||||
|
||||
$--font-path: "~element-plus/theme-chalk/fonts";
|
||||
|
||||
// the :export directive is the magic sauce for webpack
|
||||
// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass
|
||||
:export {
|
||||
|
||||
6
src/styles/element-variables.scss.d.ts
vendored
Normal file
6
src/styles/element-variables.scss.d.ts
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
export interface ScssVariables {
|
||||
theme: string
|
||||
}
|
||||
export const variables: ScssVariables
|
||||
|
||||
export default variables
|
||||
@@ -43,14 +43,14 @@ export default ({command, mode}: ConfigEnv): UserConfig => {
|
||||
},
|
||||
// SCSS 变量导出
|
||||
// @see https://www.vitejs.net/config/#css-preprocessoroptions
|
||||
css: {
|
||||
/*css: {
|
||||
preprocessorOptions: {
|
||||
scss: {
|
||||
additionalData: `@import "./src/styles/element-variables.scss";`,
|
||||
javascriptEnabled: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user