Update theme options and persist OLED dark theme if selected

This commit is contained in:
Danny Liu 2024-03-27 16:04:34 -07:00
parent c24d9d3bea
commit 25c71d8ac2
2 changed files with 17 additions and 10 deletions

View file

@ -9,7 +9,11 @@
<script>
// On page load or when changing themes, best to add inline in `head` to avoid FOUC
(() => {
if (
if (localStorage.theme.includes('oled')) {
document.documentElement.style.setProperty('--color-gray-900', '#000000');
document.documentElement.classList.add('dark');
}
else if (
localStorage.theme === 'light' ||
(!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: light)').matches)
) {