Skip to content

Commit

Permalink
Update default dark mode and file/dir icon svgs
Browse files Browse the repository at this point in the history
  • Loading branch information
sadmanca committed May 4, 2024
1 parent 326f445 commit 3fa8f35
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion asset/dir.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion asset/file.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 7 additions & 12 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,17 @@
(async () => {
var useDarkThemeCookie = await localStorage.getItem("useDarkTheme");
if (useDarkThemeCookie) {
window.useDarkTheme = useDarkThemeCookie
? JSON.parse(useDarkThemeCookie)
: useDarkThemeCookie;
window.useDarkTheme = JSON.parse(useDarkThemeCookie);
} else {
if (window.matchMedia) {
if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
useDarkTheme = true;
} else {
useDarkTheme = false;
window.useDarkTheme = true; // Default to dark theme
if (window.matchMedia) {
if (!window.matchMedia("(prefers-color-scheme: dark)").matches) {
window.useDarkTheme = false; // If not in dark mode by default
}
}
} else {
useDarkTheme = true; // default is dark 🤓
}
}
useDarkTheme ? darkreader.enable() : darkreader.disable();
})();
})();
</script>
</head>
<body>
Expand Down

0 comments on commit 3fa8f35

Please sign in to comment.