Commit 706212a
book: fix code styling in dark mode
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 #2120
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>1 parent 4911782 commit 706212a
2 files changed
+17
-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 | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
86 | 93 | | |
87 | 94 | | |
88 | 95 | | |
| |||
0 commit comments