mirror of
https://github.com/kognise/water.css.git
synced 2025-12-06 06:44:58 +01:00
fix: update css imports to be independent from CDN
This commit is contained in:
parent
eca4067fb0
commit
4cf2713004
5 changed files with 12 additions and 20 deletions
|
|
@ -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" />
|
||||
|
|
|
|||
|
|
@ -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'),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue