fix: restore bold and italic colors on light slides - #2
Open
Betisman wants to merge 1 commit into
Open
Conversation
`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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
On a
lightslide, bold text is invisible — white on white — and italic text renders near-white.The theme sets these on the bare
section:The
.lightclass restoresh1–h4,p,li,a,code,pre,table th,table td,blockquoteandhr— but neverstrongorem.Restoring the block-level colors isn't enough:
section strongmatches the<strong>element directly, so it beats the color the element would otherwise inherit fromsection.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
npx marp --theme ./orbitant.css --images png repro.mdBefore: "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
#212121matchessection.light/section.light h1;#555555matchessection.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.accentinherits the fix, since it carries.lighttoo.Why it slipped through
example.md's light slides use plain text, a numbered list and a table with no inline emphasis, sodocs/slide-06.pnglooks fine. Adding**bold**and*italic*there would make it a visible regression case, but that stales the hand-madedocs/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