This commit is contained in:
syuilo 2020-02-17 06:37:39 +09:00
parent 740d09f677
commit 56fbc889aa
5 changed files with 5 additions and 2 deletions

View file

@ -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;
}
}

View file

@ -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)',

View file

@ -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)',

View file

@ -12,6 +12,7 @@
panel: '#1f1d30',
bg: '#0f0e17',
fg: '#b1bee3',
html: '@accent',
renote: '@accent',
},
}

View file

@ -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);