fix: adapt color-theme attribute on root based on theme
This commit is contained in:
parent
de83805fd9
commit
afac1f62ca
4 changed files with 4 additions and 0 deletions
1
packages/codemirror/themes.mjs
vendored
1
packages/codemirror/themes.mjs
vendored
|
|
@ -198,6 +198,7 @@ export function activateTheme(name) {
|
||||||
const themeSettings = settings[name] || settings.strudelTheme;
|
const themeSettings = settings[name] || settings.strudelTheme;
|
||||||
// set css variables
|
// set css variables
|
||||||
themeStyle.innerHTML = `:root {
|
themeStyle.innerHTML = `:root {
|
||||||
|
color-scheme: ${themeSettings.light ? 'light' : 'dark'};
|
||||||
${Object.entries(themeSettings)
|
${Object.entries(themeSettings)
|
||||||
// important to override fallback
|
// important to override fallback
|
||||||
.map(([key, value]) => `--${key}: ${value} !important;`)
|
.map(([key, value]) => `--${key}: ${value} !important;`)
|
||||||
|
|
|
||||||
1
packages/codemirror/themes/CutiePi.mjs
vendored
1
packages/codemirror/themes/CutiePi.mjs
vendored
|
|
@ -25,6 +25,7 @@ export const settings = {
|
||||||
gutterForeground: lightGrey,
|
gutterForeground: lightGrey,
|
||||||
gutterBorder: 'transparent',
|
gutterBorder: 'transparent',
|
||||||
lineHighlight: pinkAccent,
|
lineHighlight: pinkAccent,
|
||||||
|
light: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default createTheme({
|
export default createTheme({
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ const baseNoTrailing = BASE_URL.endsWith('/') ? BASE_URL.slice(0, -1) : BASE_URL
|
||||||
<!-- the following variables are just a fallback to make sure everything is readable without JS -->
|
<!-- the following variables are just a fallback to make sure everything is readable without JS -->
|
||||||
<style is:global>
|
<style is:global>
|
||||||
:root {
|
:root {
|
||||||
|
color-scheme: dark;
|
||||||
--background: #222;
|
--background: #222;
|
||||||
--lineBackground: #22222299;
|
--lineBackground: #22222299;
|
||||||
--foreground: #fff;
|
--foreground: #fff;
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ const baseNoTrailing = BASE_URL.endsWith('/') ? BASE_URL.slice(0, -1) : BASE_URL
|
||||||
<!-- the following variables are just a fallback to make sure everything is readable without JS -->
|
<!-- the following variables are just a fallback to make sure everything is readable without JS -->
|
||||||
<style is:global>
|
<style is:global>
|
||||||
:root {
|
:root {
|
||||||
|
color-scheme: dark;
|
||||||
--background: #222;
|
--background: #222;
|
||||||
--lineBackground: #22222299;
|
--lineBackground: #22222299;
|
||||||
--foreground: #fff;
|
--foreground: #fff;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue