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 88 ; ( function ( ) {
99 const prefersDark = window . matchMedia && window . matchMedia ( '(prefers-color-scheme: dark)' ) . matches
1010 const setting = localStorage . getItem ( 'vueuse-color-scheme' ) || 'auto'
11-
12- if ( setting === 'dark' || ( prefersDark && setting !== 'light' ) ) {
11+ if ( setting === 'dark' || ( prefersDark && setting !== 'light' ) )
1312 document . documentElement . classList . toggle ( 'dark' , true )
14- } else {
15- document . documentElement . classList . toggle ( 'light' , true )
16- }
1713 } ) ( )
1814 </ script >
1915 </ head >
Original file line number Diff line number Diff line change 11<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" >
33 <slot />
4- </div >
4+ </main >
55</template >
Original file line number Diff line number Diff line change 44 overflow-x : hidden ;
55}
66
7+ html {
8+ background : var (--van-gray-1 );
9+ color-scheme : light ;
10+ }
11+
712html .dark {
813 background : #121212 ;
914 color-scheme : dark ;
Original file line number Diff line number Diff line change @@ -72,15 +72,15 @@ const onClickLeft = () => history.back()
7272 <VanNavBar title =" 📊 Echarts" left-arrow fixed @click-left =" onClickLeft" />
7373
7474 <Container >
75- <div class =" chart light:bg-white " >
75+ <div class =" chart" >
7676 <Chart :option =" refBarOption" :style =" { height: '330px' }" />
7777 </div >
7878
79- <div class =" chart item light:bg-white " >
79+ <div class =" chart item" >
8080 <Chart :option =" refLineOption" :style =" { height: '330px' }" />
8181 </div >
8282
83- <div class =" chart item light:bg-white " >
83+ <div class =" chart item" >
8484 <Chart :option =" refScoreOption" :style =" { height: '330px' }" />
8585 </div >
8686 </Container >
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ function toggle() {
1818 </script >
1919
2020<template >
21- <div class =" h-full w-full py-60" light = " bg-[--van-gray-1] " >
21+ <main class =" h-full w-full py-60" >
2222 <VanCellGroup inset title =" 一个集成最新技术栈、完整干净的移动端模板" >
2323 <VanCell center title =" 🌗 暗黑模式" >
2424 <template #right-icon >
@@ -40,5 +40,5 @@ function toggle() {
4040 </template >
4141 </VanCell >
4242 </VanCellGroup >
43- </div >
43+ </main >
4444</template >
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ const onClickLeft = () => history.back()
3232 来自异步请求的数据
3333 </div >
3434
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]" >
3636 <div v-if =" messages" >
3737 {{ messages }}
3838 </div >
You can’t perform that action at this time.
0 commit comments