css themes fixed
This commit is contained in:
+3
-3
@@ -28,7 +28,7 @@ function formatDKKShort(value) {
|
||||
|
||||
function getThemeColors() {
|
||||
const theme = document.documentElement.getAttribute('data-theme');
|
||||
const isDark = theme === 'tokyo';
|
||||
const isDark = theme === 'macchiato';
|
||||
return {
|
||||
isDark,
|
||||
textColor: isDark ? '#e8f4ff' : '#1a1d22',
|
||||
@@ -663,7 +663,7 @@ document.addEventListener('click', (e) => {
|
||||
(() => {
|
||||
function currentSystemTheme() {
|
||||
return window.matchMedia('(prefers-color-scheme: dark)').matches
|
||||
? 'tokyo'
|
||||
? 'macchiato'
|
||||
: 'light';
|
||||
}
|
||||
const btn = document.getElementById('theme-toggle');
|
||||
@@ -671,7 +671,7 @@ document.addEventListener('click', (e) => {
|
||||
btn.addEventListener('click', () => {
|
||||
const current =
|
||||
document.documentElement.getAttribute('data-theme') || 'light';
|
||||
const next = current === 'light' ? 'tokyo' : 'light';
|
||||
const next = current === 'light' ? 'macchiato' : 'light';
|
||||
document.documentElement.setAttribute('data-theme', next);
|
||||
localStorage.setItem('poc-theme', next);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user