File tree Expand file tree Collapse file tree 4 files changed +20
-7
lines changed Expand file tree Collapse file tree 4 files changed +20
-7
lines changed Original file line number Diff line number Diff line change 1
1
import { defineStore } from 'pinia'
2
- import { StyleProvider , Themes } from '@varlet/ui'
2
+ import { darkTheme } from '@/styles/dark'
3
+ import { lightTheme } from '@/styles/light'
3
4
4
5
export interface AppStore {
5
6
swithMode : ( val : string ) => void
@@ -17,9 +18,7 @@ const useAppStore = defineStore('app', () => {
17
18
const mode = ref ( theme )
18
19
19
20
const swithMode = ( val : string ) => {
20
- const rootStyleVars = val === 'light'
21
- ? Themes . toViewport ( { '--color-body' : '#f7f8fa' , '--result-title-font-size' : '32px' , '--result-description-font-size' : '14px' } )
22
- : Themes . toViewport ( { ...Themes . dark , '--result-title-font-size' : '32px' , '--result-description-font-size' : '14px' } )
21
+ const rootStyleVars = val === 'light' ? lightTheme : darkTheme
23
22
StyleProvider ( rootStyleVars )
24
23
25
24
mode . value = val
Original file line number Diff line number Diff line change @@ -32,12 +32,12 @@ body {
32
32
// NProgress Style
33
33
#nprogress {
34
34
.bar {
35
- background : #81d8d0 !important ;
35
+ background : var ( --color-nprogress ) !important ;
36
36
}
37
37
38
38
.spinner-icon {
39
- border-top-color : #81d8d0 ;
40
- border-left-color : #81d8d0 ;
39
+ border-top-color : var ( --color-nprogress ) ;
40
+ border-left-color : var ( --color-nprogress ) ;
41
41
}
42
42
}
43
43
Original file line number Diff line number Diff line change
1
+ import { Themes } from '@varlet/ui'
2
+
3
+ export const darkTheme = Themes . toViewport ( {
4
+ ...Themes . dark ,
5
+ '--color-primary' : '#00C16A' ,
6
+ '--color-nprogress' : '#D9FBE8' ,
7
+ } )
Original file line number Diff line number Diff line change
1
+ import { Themes } from '@varlet/ui'
2
+
3
+ export const lightTheme = Themes . toViewport ( {
4
+ '--color-primary' : '#00C16A' ,
5
+ '--color-nprogress' : '#75EDAE' ,
6
+ '--color-body' : '#f7f8fa' ,
7
+ } )
You can’t perform that action at this time.
0 commit comments