File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
packages/vuetify/src/composables Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,7 @@ export interface ThemeInstance {
104
104
toggle : ( themeArray ?: [ string , string ] ) => void
105
105
106
106
readonly isDisabled : boolean
107
+ readonly isSystem : Readonly < Ref < boolean > >
107
108
readonly themes : Ref < Record < string , InternalThemeDefinition > >
108
109
109
110
readonly name : Readonly < Ref < string > >
@@ -379,6 +380,8 @@ export function createTheme (options?: ThemeOptions): ThemeInstance & { install:
379
380
380
381
const current = toRef ( ( ) => computedThemes . value [ name . value ] )
381
382
383
+ const isSystem = toRef ( ( ) => _name . value === 'system' )
384
+
382
385
const styles = computed ( ( ) => {
383
386
const lines : string [ ] = [ ]
384
387
const important = parsedOptions . unimportant ? '' : ' !important'
@@ -485,7 +488,7 @@ export function createTheme (options?: ThemeOptions): ThemeInstance & { install:
485
488
}
486
489
487
490
function change ( themeName : string ) {
488
- if ( ! themeNames . value . includes ( themeName ) ) {
491
+ if ( themeName !== 'system' && ! themeNames . value . includes ( themeName ) ) {
489
492
consoleWarn ( `Theme "${ themeName } " not found on the Vuetify theme instance` )
490
493
return
491
494
}
@@ -522,6 +525,7 @@ export function createTheme (options?: ThemeOptions): ThemeInstance & { install:
522
525
cycle,
523
526
toggle,
524
527
isDisabled : parsedOptions . isDisabled ,
528
+ isSystem,
525
529
name,
526
530
themes,
527
531
current,
You can’t perform that action at this time.
0 commit comments