File tree Expand file tree Collapse file tree 6 files changed +14
-13
lines changed Expand file tree Collapse file tree 6 files changed +14
-13
lines changed Original file line number Diff line number Diff line change 8
8
; ( function ( ) {
9
9
const prefersDark = window . matchMedia && window . matchMedia ( '(prefers-color-scheme: dark)' ) . matches
10
10
const setting = localStorage . getItem ( 'vueuse-color-scheme' ) || 'auto'
11
-
12
- if ( setting === 'dark' || ( prefersDark && setting !== 'light' ) ) {
11
+ if ( setting === 'dark' || ( prefersDark && setting !== 'light' ) )
13
12
document . documentElement . classList . toggle ( 'dark' , true )
14
- } else {
15
- document . documentElement . classList . toggle ( 'light' , true )
16
- }
17
13
} ) ( )
18
14
</ script >
19
15
</ head >
Original file line number Diff line number Diff line change 1
1
<template >
2
- <div class =" h-full w-full p-16 py-60" light = " bg-[--van-gray-1] " >
2
+ <main class =" h-full w-full p-16 py-60" >
3
3
<slot />
4
- </div >
4
+ </main >
5
5
</template >
Original file line number Diff line number Diff line change 4
4
overflow-x : hidden ;
5
5
}
6
6
7
+ html {
8
+ background : var (--van-gray-1 );
9
+ color-scheme : light ;
10
+ }
11
+
7
12
html .dark {
8
13
background : #121212 ;
9
14
color-scheme : dark ;
Original file line number Diff line number Diff line change @@ -72,15 +72,15 @@ const onClickLeft = () => history.back()
72
72
<VanNavBar title =" 📊 Echarts" left-arrow fixed @click-left =" onClickLeft" />
73
73
74
74
<Container >
75
- <div class =" chart light:bg-white " >
75
+ <div class =" chart" >
76
76
<Chart :option =" refBarOption" :style =" { height: '330px' }" />
77
77
</div >
78
78
79
- <div class =" chart item light:bg-white " >
79
+ <div class =" chart item" >
80
80
<Chart :option =" refLineOption" :style =" { height: '330px' }" />
81
81
</div >
82
82
83
- <div class =" chart item light:bg-white " >
83
+ <div class =" chart item" >
84
84
<Chart :option =" refScoreOption" :style =" { height: '330px' }" />
85
85
</div >
86
86
</Container >
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ function toggle() {
18
18
</script >
19
19
20
20
<template >
21
- <div class =" h-full w-full py-60" light = " bg-[--van-gray-1] " >
21
+ <main class =" h-full w-full py-60" >
22
22
<VanCellGroup inset title =" 一个集成最新技术栈、完整干净的移动端模板" >
23
23
<VanCell center title =" 🌗 暗黑模式" >
24
24
<template #right-icon >
@@ -40,5 +40,5 @@ function toggle() {
40
40
</template >
41
41
</VanCell >
42
42
</VanCellGroup >
43
- </div >
43
+ </main >
44
44
</template >
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ const onClickLeft = () => history.back()
32
32
来自异步请求的数据
33
33
</div >
34
34
35
- <div class =" data-content dark:bg-[--van-background-2] light:bg-white " >
35
+ <div class =" data-content bg-white dark:bg-[--van-background-2]" >
36
36
<div v-if =" messages" >
37
37
{{ messages }}
38
38
</div >
You can’t perform that action at this time.
0 commit comments