Styling updates, more robust dynamic/userpref light/dark switching. Sync with paskia-js.
This commit is contained in:
@@ -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()))
|
||||
|
||||
Reference in New Issue
Block a user