We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e8a7816 commit 3663c05Copy full SHA for 3663c05
1 file changed
_includes/head-custom.html
@@ -1 +1,12 @@
1
-<link rel="stylesheet" href="{{ '/assets/css/main.css' | relative_url }}">
+<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