themes
This commit is contained in:
+11
-1
@@ -9,7 +9,17 @@
|
||||
%sveltekit.head%
|
||||
</head>
|
||||
<body data-sveltekit-preload-data="hover">
|
||||
<script src="%sveltekit.assets%/themeGetter.ts"></script>
|
||||
<!-- <script>-->
|
||||
<!-- const saved_theme = localStorage.getItem('theme');-->
|
||||
<!-- if (saved_theme) {-->
|
||||
<!-- document.body.setAttribute('data-theme', saved_theme);-->
|
||||
<!-- } else {-->
|
||||
<!-- const prefers_dark = window.matchMedia('(prefers-color-scheme: dark)').matches;-->
|
||||
<!-- const theme = prefers_dark ? 'dark' : 'light';-->
|
||||
<!-- document.body.setAttribute('data-theme', theme);-->
|
||||
<!-- localStorage.setItem('theme', theme);-->
|
||||
<!-- }-->
|
||||
<!-- </script>-->
|
||||
<div style="display: contents">%sveltekit.body%</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user