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 11import { defineStore } from 'pinia'
2- import { StyleProvider , Themes } from '@varlet/ui'
2+ import { darkTheme } from '@/styles/dark'
3+ import { lightTheme } from '@/styles/light'
34
45export interface AppStore {
56 swithMode : ( val : string ) => void
@@ -17,9 +18,7 @@ const useAppStore = defineStore('app', () => {
1718 const mode = ref ( theme )
1819
1920 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
2322 StyleProvider ( rootStyleVars )
2423
2524 mode . value = val
Original file line number Diff line number Diff line change @@ -32,12 +32,12 @@ body {
3232// NProgress Style
3333#nprogress {
3434 .bar {
35- background : #81d8d0 !important ;
35+ background : var ( --color-nprogress ) !important ;
3636 }
3737
3838 .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 ) ;
4141 }
4242}
4343
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