Skip to content

Commit

Permalink
Merge pull request #2 from alshedivat/master
Browse files Browse the repository at this point in the history
Fix theme (alshedivat#697)
  • Loading branch information
mzelinka authored Jun 10, 2022
2 parents 31dbc24 + 4e460ee commit 23fa729
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion assets/js/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,13 @@ let transTheme = () => {


let initTheme = (theme) => {
if (theme == null) {
if (theme == null || theme == 'null') {
const userPref = window.matchMedia;
if (userPref && userPref('(prefers-color-scheme: dark)').matches) {
theme = 'dark';
}
}

setTheme(theme);
}

Expand Down

0 comments on commit 23fa729

Please sign in to comment.