Merge pull request #4975 from sebdanielsson/automatic-theme-update

fix: Update color theme on system change
This commit is contained in:
Timothy Jaeryang Baek 2024-08-30 19:37:24 +02:00 committed by GitHub
commit f75908ebe3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -22,6 +22,10 @@
<script>
// On page load or when changing themes, best to add inline in `head` to avoid FOUC
(() => {
if (!localStorage?.theme) {
localStorage.theme = 'system';
}
if (localStorage?.theme && localStorage?.theme.includes('oled')) {
document.documentElement.style.setProperty('--color-gray-800', '#101010');
document.documentElement.style.setProperty('--color-gray-850', '#050505');