Skip to content

Commit

Permalink
how does this break everything
Browse files Browse the repository at this point in the history
  • Loading branch information
3vorp committed Oct 27, 2024
1 parent ded3c95 commit ef8055e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

<link rel="stylesheet" href="" id="theme">
<!-- Slimmed down version of actual theme script to speed up theme loading -->
<script>const css=document.getElementById('theme');const btn=document.getElementById('theme-btn');const THEME_VALUES=[{value:'auto'},{value:'dark'},{value:'light'}];const THEME_DEFAULT_VALUE=THEME_VALUES[0].value;const THEME_LOCALSTORAGE_KEY='theme';window.theme={get currentTheme(){return localStorage.getItem(THEME_LOCALSTORAGE_KEY)||THEME_DEFAULT_VALUE}};if(theme.currentTheme==='dark'||(theme.currentTheme==='auto'&&matchMedia('(prefers-color-scheme: dark)').matches)){css.href='/css/dark.css'}else{css.href='/css/light.css'}</script>
<script>const css=document.getElementById('theme');const btn=document.getElementById('ThemeBtn');const THEME_VALUES=[{value:'auto'},{value:'dark'},{value:'light'}];const THEME_DEFAULT_VALUE=THEME_VALUES[0].value;const THEME_LOCALSTORAGE_KEY='theme';window.theme={get currentTheme(){return localStorage.getItem(THEME_LOCALSTORAGE_KEY)||THEME_DEFAULT_VALUE}};if(theme.currentTheme==='dark'||(theme.currentTheme==='auto'&&matchMedia('(prefers-color-scheme: dark)').matches)){css.href='/css/dark.css'}else{css.href='/css/light.css'}</script>
<script defer src="/js/theme.js" type="module"></script>

<!-- make vue globally available everywhere -->
Expand Down Expand Up @@ -254,7 +254,7 @@
</li>

<li class="nav-item theme-switch-wrapper">
<btn id="theme-btn" onclick="cycleTheme()" class="nav-link">
<btn id="ThemeBtn" onclick="cycleTheme()" class="nav-link">
<i class="fas"></i> Auto Theme
</btn>
</li>
Expand Down
2 changes: 1 addition & 1 deletion js/theme.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* global localStorage */

const css = document.getElementById('theme')
const btn = document.getElementById('theme-btn')
const btn = document.getElementById('ThemeBtn')

const THEME_VALUES = [
{
Expand Down

0 comments on commit ef8055e

Please sign in to comment.