From 81263a410604d62da9afbd2a3e71a9e2976e1890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=9D=E5=85=88=E7=91=9E?= <1490493387@qq.com> Date: Thu, 24 Feb 2022 00:15:46 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20SCSS=E5=8F=98=E9=87=8F=E5=AF=BC?= =?UTF-8?q?=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/styles/element-variables.scss | 2 ++ src/styles/element-variables.scss.d.ts | 6 ++++++ vite.config.ts | 4 ++-- 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 src/styles/element-variables.scss.d.ts diff --git a/src/styles/element-variables.scss b/src/styles/element-variables.scss index 4779894d..4348ace1 100644 --- a/src/styles/element-variables.scss +++ b/src/styles/element-variables.scss @@ -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 { diff --git a/src/styles/element-variables.scss.d.ts b/src/styles/element-variables.scss.d.ts new file mode 100644 index 00000000..cc6cf24d --- /dev/null +++ b/src/styles/element-variables.scss.d.ts @@ -0,0 +1,6 @@ +export interface ScssVariables { + theme: string +} +export const variables: ScssVariables + +export default variables diff --git a/vite.config.ts b/vite.config.ts index 7b53a642..bfb0cd39 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -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 } } - } + }*/ } ) }