mirror of
https://github.com/kognise/water.css.git
synced 2025-08-12 16:14:34 +02:00
fix: update regex so only valid themes in URL params are used
This commit is contained in:
@@ -114,8 +114,9 @@ const createColorSchemeListener = (scheme, queryHandler) => {
|
||||
}
|
||||
|
||||
const themeFromParams = queryParams.get('theme')
|
||||
/** @type {VersionOptions} */
|
||||
const initialVersionOptions = {
|
||||
theme: /** @type {Theme} */ (/dark|light/.test(themeFromParams) ? themeFromParams : 'dark'),
|
||||
theme: /** @type {Theme} */ (/^(dark|light)$/.test(themeFromParams) ? themeFromParams : 'dark'),
|
||||
isLegacy: queryParams.has('legacy') || !supportsCssVars,
|
||||
isStandalone: queryParams.has('standalone'),
|
||||
}
|
||||
|
Reference in New Issue
Block a user