diff options
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/DynamicTheme.vue | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/components/DynamicTheme.vue b/src/components/DynamicTheme.vue index 2ccb47b..fc2fd55 100644 --- a/src/components/DynamicTheme.vue +++ b/src/components/DynamicTheme.vue | |||
@@ -1,17 +1,15 @@ | |||
1 | <template> | 1 | <template> |
2 | <DynamicStyle> | 2 | <DynamicStyle> |
3 | /* light / dark theme switch based on system pref if available */ body #app | 3 | :root, body #app.is-light { |
4 | { | ||
5 | {{ getVars(themes.light) }} | 4 | {{ getVars(themes.light) }} |
6 | } @media (prefers-color-scheme: light), (prefers-color-scheme: | 5 | } @media (prefers-color-scheme: light), (prefers-color-scheme: |
7 | no-preference) { body #app { | 6 | no-preference) { :root, body #app { |
8 | {{ getVars(themes.light) }} | 7 | {{ getVars(themes.light) }} |
9 | } } @media (prefers-color-scheme: dark) { body #app { } } /* light / dark | 8 | } } body #app.is-dark { |
10 | theme override base on user choice. */ body #app.is-dark { | ||
11 | {{ getVars(themes.dark) }} | 9 | {{ getVars(themes.dark) }} |
12 | } body #app.is-light { | 10 | } @media (prefers-color-scheme: dark) { :root, body #app { |
13 | {{ getVars(themes.light) }} | 11 | {{ getVars(themes.dark) }} |
14 | } | 12 | } } |
15 | </DynamicStyle> | 13 | </DynamicStyle> |
16 | </template> | 14 | </template> |
17 | 15 | ||