1
0
mirror of https://github.com/kognise/water.css.git synced 2025-08-21 04:11:30 +02:00

fix: update css imports to be independent from CDN

This commit is contained in:
Jonas Kuske
2019-06-09 14:27:34 +02:00
parent eca4067fb0
commit 4cf2713004
5 changed files with 12 additions and 20 deletions

View File

@@ -18,23 +18,14 @@
<meta name="theme-color" content="#ffffff" />
<!-- Startup styles of water.css, so styles don't have to wait until JS is loaded -->
<!-- <link
rel="preload"
as="style"
href="https://cdn.jsdelivr.net/gh/kognise/water.css/dist/dark-legacy.standalone.min.css"
/>
<link rel="preload" as="style" href="../dark-legacy.standalone.min.css" />
<link
rel="preload"
as="style"
href="https://cdn.jsdelivr.net/gh/kognise/water.css/dist/dark-legacy.standalone.min.css"
media="(prefers-color-scheme: dark)"
href="../dark-legacy.standalone.min.css"
/>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/gh/kognise/water.css/dist/dark-legacy.min.css"
/> -->
<!-- TODO: Remove once water.css v2 is hosted so the above links work -->
<link rel="stylesheet" id="js-startup-stylesheet" href="../dark.min.css" />
<link rel="stylesheet" id="js-startup-stylesheet" href="../dark-legacy.min.css" />
<!-- Dynamic version of water.css, overwrites startup styles. JavaScript sets & updates href -->
<link rel="stylesheet" id="js-stylesheet" />

View File

@@ -122,7 +122,7 @@ const createColorSchemeListener = (scheme, queryHandler) => {
const themeFromParams = queryParams.get('theme')
/** @type {VersionOptions} */
const initialVersionOptions = {
theme: /** @type {Theme} */ (/^(dark|light)$/.test(themeFromParams) ? themeFromParams : 'dark'),
theme: themeFromParams === 'dark' || themeFromParams === 'light' ? themeFromParams : 'dark',
isLegacy: queryParams.has('legacy') || !supportsCssVars,
isStandalone: queryParams.has('standalone'),
}