Commit f1b4446
committed
Fix dark highlighting themes missing base text color
Dark syntax highlighting themes like zenburn and espresso define
text-color at the top level of the theme JSON but omit "Normal"
from text-styles. generateThemeCssClasses() only checked
text-styles for the base span color, so no `code.sourceCode > span`
rule was emitted for these themes. When layered over a light theme
that does emit a span-level color (e.g., kate), the light theme's
near-black text persists in dark mode, making unhighlighted tokens
invisible.
Add a fallback after the text-styles loop: if no base text color
was generated (no "" key in tokenCssByAbbr), check the top-level
text-color and emit the same CSS rules that Normal would have
produced. Uses generateCssKeyValues() to stay consistent with the
existing code path.
Fixes #140991 parent d1c3de0 commit f1b4446
1 file changed
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
565 | 565 | | |
566 | 566 | | |
567 | 567 | | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
568 | 592 | | |
569 | 593 | | |
570 | 594 | | |
| |||
0 commit comments