Skip to content

Commit c2ba75b

Browse files
committed
fix: improved legibility in dark mode
1 parent 6fa3e1f commit c2ba75b

File tree

9 files changed

+69
-571
lines changed

9 files changed

+69
-571
lines changed

docs/compute-engine/api.md

Lines changed: 20 additions & 553 deletions
Large diffs are not rendered by default.

docs/mathfield/01-introduction.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -442,10 +442,10 @@ div.figure {
442442
```live
443443
:::style
444444
math-field {
445-
border: 1px solid var(--neutral-400);
446-
background: var(--neutral-200);
447-
border-radius: 8px;
448-
padding: 8px;
445+
border: 1px solid var(--neutral-400);
446+
background: var(--neutral-200);
447+
border-radius: 8px;
448+
padding: 8px;
449449
}
450450
@media (pointer: coarse) {
451451
math-field {
@@ -460,10 +460,10 @@ div.figure {
460460
inset 4px 4px 16px rgb(0 0 0 / 10%),
461461
inset 2px 2px 8px rgb(0 0 0 / 60%);
462462
463-
--smart-fence-color: white;
464-
--caret-color: var(--blue-400);
465-
--selection-background-color: var(--blue-300);
466-
--contains-highlight-background-color: var(--blue-900);
463+
--smart-fence-color: white;
464+
--caret-color: var(--blue-400);
465+
--selection-background-color: var(--blue-300);
466+
--contains-highlight-background-color: var(--blue-900);
467467
}
468468
math-field:focus {
469469
outline: 4px solid rgb(255 255 255 / 25%);

plugins/code-playground/index.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,17 @@ async function toJsxNode(node) {
8686
const value = node.value;
8787

8888
// "style" is for inline styles
89-
const style = value.match(/:::style\s*\n([\s\S]*?)(\n:::|$)/)?.[1];
90-
89+
let style = value.match(/:::style\s*\n([\s\S]*?)(\n:::|$)/)?.[1];
90+
91+
/** @fixme: tempory: should be able to use CSS variables instead*/
92+
style = `
93+
math-field {
94+
border: 1px solid var(--neutral-400);
95+
background: var(--neutral-200);
96+
border-radius: 8px;
97+
padding: 8px;
98+
}
99+
` + style;
91100
// "html" and "js" are for editable blocks
92101
const html = value.match(/:::html\s*\n([\s\S]*?)(\n:::|$)/)?.[1];
93102
let js = value.match(

src/components/Intro/styles.module.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
padding-block: 1em;
77
}
88

9+
:root[data-theme="dark"] .intro {
10+
color: var(--blue-400);
11+
}
12+
913
.intro a {
1014
text-decoration: underline;
1115
}

src/css/code.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
}
4242

43-
[data-theme='dark'] {
43+
:root[data-theme='dark'] {
4444
--console-background: var(--base-00);
4545
--code-background: var(--neutral-100);
4646
}
@@ -55,8 +55,8 @@ code {
5555
border-radius: 4px;
5656
}
5757

58-
[data-theme='dark'] code {
59-
color: var(--primary-color-light);
58+
:root[data-theme='dark'] code {
59+
color: var(--blue-300);
6060
border: 1px solid var(--neutral-600);
6161
}
6262

src/css/colors.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@
180180
--magenta-900: #8a004c;
181181
}
182182

183-
[data-theme='dark'] {
183+
:root[data-theme='dark'] {
184184

185185
--semantic-blue: var(--blue-700);
186186
--semantic-red: var(--red-400);
@@ -236,7 +236,7 @@
236236
237237
}
238238
239-
[data-theme='dark'] {
239+
:root[data-theme='dark'] {
240240
--neutral-900: #302e33;
241241
--neutral-800: #3b3a3f;
242242
--neutral-700: hsl(255,3%, 30%);

src/css/custom.css

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@
4343
--ifm-toc-padding-horizontal: 1em;
4444
}
4545

46+
math-field {
47+
border: 1px solid var(--neutral-400);
48+
background: var(--neutral-200);
49+
border-radius: 8px;
50+
padding: 8px;
51+
background: red;
52+
}
53+
54+
4655
.table-of-contents {
4756
/* Do not display scrollbars: */
4857
overflow:hidden;
@@ -119,7 +128,7 @@
119128
}
120129

121130
/* For readability concerns, you should choose a lighter palette in dark mode. */
122-
[data-theme="dark"] {
131+
:root[data-theme="dark"] {
123132
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
124133

125134
--ifm-code-background: var(--console-background);
@@ -221,7 +230,7 @@
221230
line-height: 1.3;
222231
}
223232

224-
[data-theme="dark"] {
233+
:root[data-theme="dark"] {
225234
--primary-color: hsl(210, 80%, 40%);
226235
--primary-color-dark: hsl(210, 80%, 30%);
227236
--primary-color-light: hsl(210, 80%, 60%);

src/css/typography.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,22 @@ body {
5454
text-wrap: balance;
5555
}
5656

57+
:root[data-theme="dark"] .markdown > h2 {
58+
color: var(--blue-300);
59+
}
60+
5761
.markdown > h3 {
5862
--ifm-h3-font-size: 1.25rem;
5963
font-weight: 600;
6064
color: var(--primary-color);
6165
text-wrap: balance;
6266
}
6367

68+
:root[data-theme="dark"] .markdown > h3 {
69+
color: var(--blue-300);
70+
}
71+
72+
6473
.markdown h1:first-child {
6574
--ifm-h1-font-size: 4rem;
6675
--ifm-heading-line-height: 1;

submodules/cortex-js.github.io

Submodule cortex-js.github.io updated 77 files

0 commit comments

Comments
 (0)