Skip to content

Commit 3663c05

Browse files
committed
updates
1 parent e8a7816 commit 3663c05

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

_includes/head-custom.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
1-
<link rel="stylesheet" href="{{ '/assets/css/main.css' | relative_url }}">
1+
<script>
2+
(function() {
3+
var root = document.documentElement;
4+
var modes = ['dark', 'light', 'gradient'];
5+
var theme = localStorage.getItem('theme');
6+
if (!theme || modes.indexOf(theme) === -1) {
7+
theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
8+
}
9+
root.setAttribute('data-theme', theme);
10+
})();
11+
</script>
12+
<link rel="stylesheet" href="{{ '/assets/css/main.css' | relative_url }}">

0 commit comments

Comments
 (0)