Skip to content

Commit

Permalink
deploy: d795d4e
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Dec 23, 2023
1 parent 9c9b13c commit fea755b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions assets/js/color-modes.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
}

const setTheme = theme => {
if (theme === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.documentElement.setAttribute('data-bs-theme', 'dark')
if (theme === 'auto') {
document.documentElement.setAttribute('data-bs-theme', (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'))
} else {
document.documentElement.setAttribute('data-bs-theme', theme)
}
Expand Down

0 comments on commit fea755b

Please sign in to comment.