Commit 8325191
committed
WIP: cleanup before squash
Fix Book code styling in dark mode by replacing hard-coded colors with variables
Book pages used hard-coded colors for inline and block code (e.g. `#eee`, `#333`)
in `book2.scss`, which prevented dark-mode styles from taking effect. As a result,
code blocks in the Git Book did not adapt correctly when switching themes.
This change replaces those hard-coded values with CSS variables
(`--book-code-bg`, `--book-code-color`, `--book-code-border`), allowing dark mode
to override Book code styling in the same way as other sections (e.g. man-pages).
Not all `code.<language>` color rules are adjusted here, as they relate to syntax
highlighting rather than theme contrast and require a separate, more holistic
approach.
An alternative approach—overriding Book code styles directly in `dark-mode.scss`
using more specific selectors—was considered but rejected, as it would further
increase selector complexity instead of fixing the root cause.
Fixes #21201 parent 0bb516b commit 8325191
2 files changed
+15
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
2 | 6 | | |
3 | 7 | | |
4 | 8 | | |
| |||
474 | 478 | | |
475 | 479 | | |
476 | 480 | | |
477 | | - | |
| 481 | + | |
478 | 482 | | |
479 | 483 | | |
480 | 484 | | |
481 | | - | |
| 485 | + | |
482 | 486 | | |
483 | 487 | | |
484 | 488 | | |
| |||
488 | 492 | | |
489 | 493 | | |
490 | 494 | | |
491 | | - | |
| 495 | + | |
492 | 496 | | |
493 | 497 | | |
494 | 498 | | |
495 | 499 | | |
496 | | - | |
497 | | - | |
498 | | - | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
499 | 503 | | |
500 | 504 | | |
501 | 505 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
85 | 90 | | |
86 | 91 | | |
87 | 92 | | |
| |||
0 commit comments