Skip to content

Fix notebook-view cell numbers illegible in dark mode - #2194

Merged
cwickham merged 1 commit into
mainfrom
fix/dark-theme-pre-color
Sep 23, 2026
Merged

cwickham merged 1 commit into
mainfrom
fix/dark-theme-pre-color

Conversation

@cwickham

@cwickham cwickham commented Sep 22, 2026

Copy link
Copy Markdown
Member

Summary

  • $pre-color defaults to near-black regardless of theme; quarto-cli's .cell-decorator reset clears the pre background but not its text color, so notebook-view cell numbers (In [1]:, etc.) are ~1.15:1 contrast in dark mode.
  • Set $pre-color: inherit, matching Bootswatch's own dark themes (darkly, cyborg).
  • Upstream: Code cell numbering in embeds is invisible in dark themes quarto-cli#14932

E.g. on https://quarto.org/docs/authoring/penguins-preview.html the light mode includes visible cell numbers:

Screenshot 2026-09-22 at 1 14 41 PM

And the dark one does not:
Screenshot 2026-09-22 at 1 14 36 PM

Test plan

  • Full-site axe scan before/after: color-contrast :: #000000 on #151515 reduced 26 → 15 instances (the remaining 15 are unrelated third-party dygraph axis labels on htmlwidgets.html); zero new/worse findings across all 303 signatures
  • Examine docs/authoring/penguins-preview.html in dark mode in the preview

Bootstrap's $pre-color defaults to near-black regardless of theme, and
quarto-cli's own .cell-decorator reset only clears the pre background,
not its text color. Set $pre-color: inherit, the same override
Bootswatch's own dark themes (darkly, cyborg) already carry.

Upstream: quarto-dev/quarto-cli#14932
@github-actions

Copy link
Copy Markdown
Contributor

📝 Preview Deployment

🔍 Full site preview: https://deploy-preview-2194.quarto.org

@cwickham
cwickham marked this pull request as ready for review September 23, 2026 16:40
@cwickham
cwickham merged commit 4348226 into main Sep 23, 2026
3 checks passed
@cwickham
cwickham deleted the fix/dark-theme-pre-color branch September 23, 2026 16:40
@github-actions

Copy link
Copy Markdown
Contributor

Successfully created backport PR for prerelease:

cwickham added a commit that referenced this pull request Sep 23, 2026
…2197)

Bootstrap's $pre-color defaults to near-black regardless of theme, and
quarto-cli's own .cell-decorator reset only clears the pre background,
not its text color. Set $pre-color: inherit, the same override
Bootswatch's own dark themes (darkly, cyborg) already carry.

Upstream: quarto-dev/quarto-cli#14932
(cherry picked from commit 4348226)

Co-authored-by: Charlotte Wickham <charlotte.wickham@posit.co>
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