Dark theme improvements

This commit is contained in:
Bastien Wirtz 2020-10-16 21:29:28 -07:00
parent e608701404
commit 67fd101a38
3 changed files with 12 additions and 12 deletions

View File

@ -159,7 +159,9 @@ export default {
} }
this.config = merge(defaults, config); this.config = merge(defaults, config);
this.services = this.config.services; this.services = this.config.services;
document.title = this.config.documentTitle || `${this.config.title} | ${this.config.subtitle}`; document.title =
this.config.documentTitle ||
`${this.config.title} | ${this.config.subtitle}`;
if (this.config.stylesheet) { if (this.config.stylesheet) {
let stylesheet = ""; let stylesheet = "";
for (const file of this.config.stylesheet) { for (const file of this.config.stylesheet) {

View File

@ -13,17 +13,17 @@
text-overflow: ellipsis; text-overflow: ellipsis;
} }
html { html, body, body #app {
height: 100%; height: 100%;
background-color: var(--background);
} }
body { body {
font-family: "Raleway", sans-serif; font-family: "Raleway", sans-serif;
height: 100%;
#app { #app {
height: auto;
min-height: 100%; min-height: 100%;
background-color: var(--background);
background-image: var(--background-image); background-image: var(--background-image);
background-size: cover; background-size: cover;
background-position: center; background-position: center;

View File

@ -1,17 +1,15 @@
<template> <template>
<DynamicStyle> <DynamicStyle>
/* light / dark theme switch based on system pref if available */ body #app :root, body #app.is-light {
{
{{ getVars(themes.light) }} {{ getVars(themes.light) }}
} @media (prefers-color-scheme: light), (prefers-color-scheme: } @media (prefers-color-scheme: light), (prefers-color-scheme:
no-preference) { body #app { no-preference) { :root, body #app {
{{ getVars(themes.light) }} {{ getVars(themes.light) }}
} } @media (prefers-color-scheme: dark) { body #app { } } /* light / dark } } body #app.is-dark {
theme override base on user choice. */ body #app.is-dark {
{{ getVars(themes.dark) }} {{ getVars(themes.dark) }}
} body #app.is-light { } @media (prefers-color-scheme: dark) { :root, body #app {
{{ getVars(themes.light) }} {{ getVars(themes.dark) }}
} } }
</DynamicStyle> </DynamicStyle>
</template> </template>