You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<scriptis:inline>constsetThemeColor=()=>{constmetaThemeColor=document.querySelector('meta[name=theme-color]')if(metaThemeColor){if(document.documentElement.classList.contains('dark')){metaThemeColor.setAttribute('content','black')}else{metaThemeColor.setAttribute('content','white')}}}consthandleToggleClick=()=>{consthtmlElement=document.documentElementconstbodyElement=document.bodyhtmlElement.classList.toggle('dark')bodyElement.classList.toggle('dark')constisDark=htmlElement.classList.contains('dark')localStorage.setItem('theme',isDark ? 'dark' : 'light')if(isDark){htmlElement.setAttribute('data-color-scheme','dark')}else{htmlElement.removeAttribute('data-color-scheme')}setThemeColor()}document.getElementById('theme-toggle').addEventListener('click',handleToggleClick)document.addEventListener('astro:after-swap',()=>{localStorage.theme==='dark'
? document.documentElement.classList.add('dark')
: document.documentElement.classList.remove('dark')})consttheme=localStorage.getItem('theme')||'light'if(theme==='light'){document.documentElement.classList.remove('dark')}else{document.documentElement.classList.add('dark')document.body.classList.add('dark')// Also add 'dark' class to body}setThemeColor()</script>
My Shiki is not changing its theme.
The text was updated successfully, but these errors were encountered:
Hi! I'm closing this issue because, as I mentioned in the linked PR here, we have an open PR to address this! 🙌 Thank you for bringing it to our attention, and sorry we didn't get the PR completed before you needed it!
Even tough I have a shikiConfig estabalished with a correct implementation of dark mode
My Shiki is not changing its theme.
The text was updated successfully, but these errors were encountered: