Skip to content

Commit

Permalink
when using dark mode , white flash appears #17
Browse files Browse the repository at this point in the history
  • Loading branch information
ferantoMSFT authored Oct 19, 2021
1 parent 174dec4 commit 12bb053
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions _includes/js/custom.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// window.matchMedia('(prefers-color-scheme: dark)')
// .addEventListener('change', event => {
// if (event.matches) {
// jtd.setTheme('dark');
// } else {
// jtd.setTheme('light');
// }
// });
window.matchMedia('(prefers-color-scheme: dark)')
.addEventListener('change', event => {
if (event.matches) {
jtd.setTheme('dark');
} else {
jtd.setTheme('light');
}
});

// if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
// jtd.setTheme('dark');
// }
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
jtd.setTheme('dark');
}

0 comments on commit 12bb053

Please sign in to comment.