Skip to content

Commit aa083ca

Browse files
committed
fix theme switcher
1 parent b447bb3 commit aa083ca

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

assets/js/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ window.addEventListener('load', function() {
150150
function setTheme(mode) {
151151
if (mode) {
152152
localStorage.setItem('bs-theme', mode);
153-
document.documentElement.setAttribute('data-bs-theme', mode === 'light' || 'darkmode');
153+
document.documentElement.setAttribute('data-bs-theme', mode === 'light' ? 'light' : 'darkmode');
154154
document.querySelectorAll('button#toggle-theme i').forEach((i) => i.classList.add('d-none'));
155155
}
156156
const modeInverse = localStorage.getItem('bs-theme') === 'light' ? 'dark' : 'light';

assets/js/main.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/main.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

default.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<script>
3838
const theme = localStorage.getItem("bs-theme") || "light";
3939
localStorage.setItem("bs-theme", theme);
40-
document.documentElement.setAttribute('data-bs-theme', theme === 'light' || 'darkmode');
40+
document.documentElement.setAttribute('data-bs-theme', theme === 'light' ? 'light' : 'darkmode');
4141
</script>
4242

4343
<nav class="navbar navbar-expand-md navbar-dark bg-dark sticky-top">

0 commit comments

Comments
 (0)