diff --git a/source/css/common/codeblock/code-theme.styl b/source/css/common/codeblock/code-theme.styl index 717b6a5..dc02ffc 100644 --- a/source/css/common/codeblock/code-theme.styl +++ b/source/css/common/codeblock/code-theme.styl @@ -56,6 +56,11 @@ code-theme(mode) { code-theme('light'); } +@media (prefers-color-scheme: light) { + :root { + code-theme('light'); + } +} @media (prefers-color-scheme: dark) { :root { diff --git a/source/css/common/variables.styl b/source/css/common/variables.styl index 603bde8..edaf408 100644 --- a/source/css/common/variables.styl +++ b/source/css/common/variables.styl @@ -140,6 +140,11 @@ root-color(mode) { root-color('light'); } +@media (prefers-color-scheme: light) { + :root { + root-color('light'); + } +} @media (prefers-color-scheme: dark) { :root { diff --git a/source/js/dark-light-toggle.js b/source/js/dark-light-toggle.js index f178ccf..0cb5f5b 100644 --- a/source/js/dark-light-toggle.js +++ b/source/js/dark-light-toggle.js @@ -9,6 +9,7 @@ KEEP.initModeToggle = () => { enableLightMode() { document.body.classList.remove('dark-mode'); + document.body.classList.add('light-mode'); this.iconDom.className = 'fas fa-moon'; KEEP.styleStatus.isDark = false; KEEP.setStyleStatus(); @@ -16,6 +17,7 @@ KEEP.initModeToggle = () => { enableDarkMode() { document.body.classList.add('dark-mode'); + document.body.classList.remove('light-mode'); this.iconDom.className = 'fas fa-sun'; KEEP.styleStatus.isDark = true; KEEP.setStyleStatus();