1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-12-12 05:38:55 +09:00
This commit is contained in:
syuilo 2020-02-17 06:37:39 +09:00
parent 26b3a14a63
commit 15839a7399
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);