Styling updates, more robust dynamic/userpref light/dark switching. Sync with paskia-js.

This commit is contained in:
2026-02-05 15:27:15 +00:00
parent 291a665e21
commit 871eb149ab
7 changed files with 100 additions and 143 deletions
+4 -4
View File
@@ -1,11 +1,11 @@
// Early theme for restricted app - first URL param wins, then localStorage
import { themeColors, applyTheme, getCachedTheme } from '@/utils/theme.js'
import { applyTheme, getCachedTheme } from '@/utils/theme.js'
function getTheme() {
const params = new URLSearchParams(location.hash.slice(1))
return params.get('theme') || getCachedTheme() || ''
}
// Use .surface selector to preserve transparent background
applyTheme(getTheme(), '.surface')
addEventListener('hashchange', () => applyTheme(getTheme(), '.surface'))
// Apply theme class to document root
applyTheme(getTheme())
addEventListener('hashchange', () => applyTheme(getTheme()))