From 15839a739983c78c13159fcbf95c9ed87b43a105 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 17 Feb 2020 06:37:39 +0900 Subject: [PATCH] :art: --- src/client/theme.ts | 2 +- src/client/themes/_dark.json5 | 1 + src/client/themes/_light.json5 | 1 + src/client/themes/halloween.json5 | 1 + src/server/web/views/base.pug | 2 +- 5 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/client/theme.ts b/src/client/theme.ts index c446528f0..576096cf7 100644 --- a/src/client/theme.ts +++ b/src/client/theme.ts @@ -52,7 +52,7 @@ export function applyTheme(theme: Theme, persist = true) { for (const tag of document.head.children) { if (tag.tagName === 'META' && tag.getAttribute('name') === 'theme-color') { - tag.setAttribute('content', props['accent']); + tag.setAttribute('content', props['html']); break; } } diff --git a/src/client/themes/_dark.json5 b/src/client/themes/_dark.json5 index af5fc3b8d..4acea0a4b 100644 --- a/src/client/themes/_dark.json5 +++ b/src/client/themes/_dark.json5 @@ -15,6 +15,7 @@ bg: '#000', fg: '#c7d1d8', fgHighlighted: ':lighten<3<@fg', + html: '@bg', panel: '#111213', shadow: 'rgba(0, 0, 0, 0.1)', header: 'rgba(20, 20, 20, 0.75)', diff --git a/src/client/themes/_light.json5 b/src/client/themes/_light.json5 index 8c67bc402..b891cc5e6 100644 --- a/src/client/themes/_light.json5 +++ b/src/client/themes/_light.json5 @@ -15,6 +15,7 @@ bg: '#fafafa', fg: '#5c6a73', fgHighlighted: ':darken<3<@fg', + html: '@bg', panel: '#fff', shadow: 'rgba(0, 0, 0, 0.1)', header: 'rgba(255, 255, 255, 0.75)', diff --git a/src/client/themes/halloween.json5 b/src/client/themes/halloween.json5 index 1394c793e..7cabf01d1 100644 --- a/src/client/themes/halloween.json5 +++ b/src/client/themes/halloween.json5 @@ -12,6 +12,7 @@ panel: '#1f1d30', bg: '#0f0e17', fg: '#b1bee3', + html: '@accent', renote: '@accent', }, } diff --git a/src/server/web/views/base.pug b/src/server/web/views/base.pug index 79ad4c527..e6751ecca 100644 --- a/src/server/web/views/base.pug +++ b/src/server/web/views/base.pug @@ -40,7 +40,7 @@ html if (theme) { for (const [k, v] of Object.entries(JSON.parse(theme))) { document.documentElement.style.setProperty(`--${k}`, v.toString()); - if (k === 'accent') { + if (k === 'html') { for (const tag of document.head.children) { if (tag.tagName === 'META' && tag.getAttribute('name') === 'theme-color') { tag.setAttribute('content', v);