mirror of
https://github.com/kognise/water.css.git
synced 2025-12-06 06:44:58 +01:00
fix: update regex so only valid themes in URL params are used
This commit is contained in:
parent
d0ca9554f0
commit
cd15e37177
3 changed files with 4 additions and 3 deletions
|
|
@ -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'),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue