Skip to content

Commit 1c8913a

Browse files
committed
Fix dark highlighting themes missing base text color
Dark syntax highlighting themes like zenburn and espresso define text-color at the top level but omit "Normal" from text-styles, so generateThemeCssClasses() never emits a span-level color rule. When layered with a light theme that does (e.g. kate emits code.sourceCode > span { color: #1f1c1b; }), the light theme's near-black text persists in dark mode. Add a span-level $code-block-color rule in _bootstrap-rules.scss alongside the existing container-level rules, following the same pattern used for background-color. Since light and dark are separate compiled stylesheets toggled by JS, the active theme's rule applies without specificity conflicts. Fixes #14099
1 parent d1c3de0 commit 1c8913a

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/resources/formats/html/bootstrap/_bootstrap-rules.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -863,6 +863,14 @@ div.sourceCode {
863863
div.sourceCode pre.sourceCode {
864864
color: $code-block-color;
865865
}
866+
// Themes that omit "Normal" from text-styles (e.g. zenburn, espresso)
867+
// don't generate a span-level color rule in the syntax highlighting CSS.
868+
// When layered with a light theme that does, the light theme's near-black
869+
// span color persists in dark mode. This ensures a base span color is set.
870+
pre > code.sourceCode > span,
871+
code.sourceCode > span {
872+
color: $code-block-color;
873+
}
866874
}
867875

868876
pre.sourceCode {

0 commit comments

Comments
 (0)