Skip to content

fix: restore bold and italic colors on light slides - #2

Open
Betisman wants to merge 1 commit into
mainfrom
fix/light-slide-inline-text-color
Open

fix: restore bold and italic colors on light slides#2
Betisman wants to merge 1 commit into
mainfrom
fix/light-slide-inline-text-color

Conversation

@Betisman

@Betisman Betisman commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

The bug

On a light slide, bold text is invisible — white on white — and italic text renders near-white.

The theme sets these on the bare section:

section strong { color: #FFFFFF; }
section em     { color: #C6C6C6; }

The .light class restores h1h4, p, li, a, code, pre, table th, table td, blockquote and hr — but never strong or em.

Restoring the block-level colors isn't enough: section strong matches the <strong> element directly, so it beats the color the element would otherwise inherit from section.light p / li / table td. Specificity never enters into it — a direct match always wins over inheritance.

So it hits paragraphs, list items and table cells alike, including bold table headers. Blockquotes were the one case already covered, by the existing section.light blockquote strong.

Repro

---
marp: true
---

<!-- _class: light -->

# Light slide: bold and italic

This has **bold text** and *italic text* in a paragraph.

- A bullet with **bold** and *italic*

| Column | **Bold header** |
| ------ | --------------- |
| **Bold cell** | plain cell |

> A blockquote with **bold** — this one already works.

npx marp --theme ./orbitant.css --images png repro.md

Before: "bold text", "bold", "Bold cell" render as blank gaps mid-sentence; "Bold header" is white on the pale blue header fill; both italics are light grey on white (~1.5:1 contrast). Only the blockquote is readable.

After: all five render correctly. The blockquote is byte-identical to before.

The fix

section.light strong {
  color: #212121;
}

section.light em {
  color: #555555;
}

#212121 matches section.light / section.light h1; #555555 matches section.light h3, h4, keeping italic as de-emphasized text rather than body text.

Scoped entirely to section.light, so dark slides cannot be affected — the diff adds two selectors and touches nothing existing. section.light.accent inherits the fix, since it carries .light too.

Why it slipped through

example.md's light slides use plain text, a numbered list and a table with no inline emphasis, so docs/slide-06.png looks fine. Adding **bold** and *italic* there would make it a visible regression case, but that stales the hand-made docs/slide-06.png, so I left both alone — happy to do it as a follow-up if you'd like the example to cover it.

Found via

Building an internal Asteroid deck on this theme: three light slides had blanks in the middle of sentences. That deck carries a local style: override for now, which can be dropped once this ships.

🤖 Generated with Claude Code

`section strong` sets white and `section em` sets #C6C6C6, but the
`.light` class never restored either. Because those selectors match the
inline element directly, they beat the color inherited from
`section.light p` / `li` / `table td` — so on a light slide **bold** text
rendered white on white (invisible) and *italic* rendered near-white.

This affected paragraphs, list items and table cells, including bold
table headers. Blockquotes were already covered by
`section.light blockquote strong`.

Scoped entirely to `section.light`, so dark slides are unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant