Skip to content

Commit 8afc15b

Browse files
committed
sass文件的自动导入
1 parent 72fa061 commit 8afc15b

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<RouterView />
88
</template>
99

10-
<style scoped>
10+
<style scoped lang="scss">
1111
header {
1212
line-height: 1.5;
1313
max-height: 100vh;

src/styles/var.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
$xtxColor: #27ba9b;
2+
$helpColor: #e26237;
3+
$sucColor: #1dc779;
4+
$warnColor: #ffb302;
5+
$priceColor: #cf4444;

vite.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ export default defineConfig({
3131
css: {
3232
preprocessorOptions: {
3333
scss: {
34-
additionalData: `@use "@/styles/element/index.scss" as *;`,
34+
additionalData: `@use "@/styles/element/index.scss" as *;
35+
@use "@/styles/var.scss" as *;`,
3536
},
3637
},
3738
},

0 commit comments

Comments
 (0)