mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-12-04 21:53:07 +02:00
fix(client): Fix theme color
This commit is contained in:
parent
6ff84a1061
commit
35a8c37922
3 changed files with 3 additions and 1 deletions
|
@ -57,6 +57,7 @@
|
||||||
badge: '#31b1ce',
|
badge: '#31b1ce',
|
||||||
messageBg: ':lighten<5<@bg',
|
messageBg: ':lighten<5<@bg',
|
||||||
deckColumnBorder: ':lighten<10<@panel',
|
deckColumnBorder: ':lighten<10<@panel',
|
||||||
|
htmlThemeColor: '@bg',
|
||||||
X1: ':alpha<0<@bg',
|
X1: ':alpha<0<@bg',
|
||||||
X2: ':darken<2<@panel',
|
X2: ':darken<2<@panel',
|
||||||
X3: 'rgba(255, 255, 255, 0.05)',
|
X3: 'rgba(255, 255, 255, 0.05)',
|
||||||
|
|
|
@ -57,6 +57,7 @@
|
||||||
badge: '#31b1ce',
|
badge: '#31b1ce',
|
||||||
messageBg: '@panel',
|
messageBg: '@panel',
|
||||||
deckColumnBorder: ':darken<20<@panel',
|
deckColumnBorder: ':darken<20<@panel',
|
||||||
|
htmlThemeColor: '@bg',
|
||||||
X1: ':alpha<0<@bg',
|
X1: ':alpha<0<@bg',
|
||||||
X2: ':darken<2<@panel',
|
X2: ':darken<2<@panel',
|
||||||
X3: 'rgba(0, 0, 0, 0.05)',
|
X3: 'rgba(0, 0, 0, 0.05)',
|
||||||
|
|
|
@ -40,7 +40,7 @@ html
|
||||||
if (theme) {
|
if (theme) {
|
||||||
for (const [k, v] of Object.entries(JSON.parse(theme))) {
|
for (const [k, v] of Object.entries(JSON.parse(theme))) {
|
||||||
document.documentElement.style.setProperty(`--${k}`, v.toString());
|
document.documentElement.style.setProperty(`--${k}`, v.toString());
|
||||||
if (k === 'html') {
|
if (k === 'htmlThemeColor') {
|
||||||
for (const tag of document.head.children) {
|
for (const tag of document.head.children) {
|
||||||
if (tag.tagName === 'META' && tag.getAttribute('name') === 'theme-color') {
|
if (tag.tagName === 'META' && tag.getAttribute('name') === 'theme-color') {
|
||||||
tag.setAttribute('content', v);
|
tag.setAttribute('content', v);
|
||||||
|
|
Loading…
Reference in a new issue