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 12bb053 commit a80046f
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 a80046f

Please sign in to comment.