Make some variables in the base post const
This commit is contained in:
parent
8e5c9ebb3a
commit
476bac98e6
1 changed files with 4 additions and 4 deletions
|
@ -10,11 +10,11 @@
|
|||
{{ partial "footer.html" . }}
|
||||
</body>
|
||||
<script>
|
||||
let bodyClasses = document.body.classList;
|
||||
let systemDarkModeMatch = window.matchMedia('(prefers-color-scheme: dark)');
|
||||
let localStorageDarkMode = localStorage.getItem('dark');
|
||||
const bodyClasses = document.body.classList;
|
||||
const systemDarkModeMatch = window.matchMedia('(prefers-color-scheme: dark)');
|
||||
const localStorageDarkMode = localStorage.getItem('dark');
|
||||
|
||||
let setDark = (isDark) => {
|
||||
const setDark = isDark => {
|
||||
bodyClasses[isDark ? 'add' : 'remove']('dark');
|
||||
localStorage.setItem('dark', isDark ? 'yes' : 'no');
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue