Repository navigation
fix(code): follow dark mode with Shiki's dark theme without typeset - #380
Conversation
The rule that swaps Shiki's inline light colors for `--shiki-dark` lived only in the typeset styles, so a page with `typeset: false` kept light-theme code on a dark page. It now ships in comark-code's styles, and in comark-diff's, whose table draws Shiki's tokens without a code block. Typeset no longer repeats it.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Important
Moving the Shiki override entirely out of typeset regresses typeset-only consumers that do not load comark-code styles.
Reviewed changes in 28e33d7: the extraction of Shiki dark-mode selectors into a shared helper, their inclusion in code and diff styles, the removal from typeset CSS, and the related documentation and tests.
- Shared Shiki override — adds one minified helper for color, font style, and font weight under explicit or system dark mode.
- Code and diff ownership — bundles that override into
comark-codeandcomark-diffso they switch themes when typeset is disabled. - Typeset removal — removes the previous scoped selectors and updates the stylesheet assertion to require their absence.
- Documentation — describes the new code-owned behavior for code blocks, diffs, and typeset.
gpt-5.6-sol | 𝕏
comark-annotate
comark-badge
comark-cards
comark-carousel
comark-cast
comark-charts
comark-chat
comark-chips
comark-cjk
comark-code
comark-code-notes
comark-colors
comark-comments
comark-critic
comark-deflist
comark-details
comark-diagrams
comark-diff
comark-embed
comark-fields
comark-figure
comark-file-tree
comark-footnotes
comark-github
comark-icon
comark-include
comark-keys
comark-links
comark-linter
comark-magic-move
comark-mark
markdown-it-to-comark
marked-to-comark
comark-mathml
comark-media
comark-metrics
migrate-to-comark
comark-outline
comark-properties
comark-qr
comark-quiz
comark-reading-time
remark-to-comark
comark-sources
comark-steps
comark-table
comark-tabs
comark-tests
comark-time
comark-ui
comark-xref
comark-zoom
commit: |
Latest result Pull request merged. Final answersSession Pull request merged. Pushed fe0b1f1, fixing Pullfrog P1: typeset-only Shiki dark themes. Added regression coverage, updated docs, and resolved the thread. Diff-package `vp test test/diff.test.ts`: 21 passed. Stylesheet assertions, focused lint, formatting, and source typecheck passed. UI tests require unbuilt workspace packages; browser verification lacked Chromium. Awaiting hosted checks. |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes since the prior Pullfrog review: the follow-up restores dark-theme switching for typeset-only consumers while retaining the original fix for code and diff styles.
- Typeset ownership — reused
shikiDarkinside typeset's existing@scope, preserving the standalone stylesheet andshikiwithcode: falsepaths. - Regression coverage — added assertions for explicit and system dark-mode selectors in the standalone stylesheet and for highlighted plain
preoutput withoutcomark-code. - Documentation — clarified that both typeset and code styles carry the Shiki theme-switching rule.
gpt-5.6-sol | 𝕏

With
typeset: false, code blocks stay on Shiki's light colors on a dark page. The rule that swaps in--shiki-darkonly shipped intypeset.css, so a site that turns typeset off has to copy it, as@vite-hub/docsdoes withhtml.dark .shiki span { color: var(--shiki-dark) !important }.This extracts the rule into
shared/shiki.tsand bundles it into comark-code's styles and comark-diff's, since a diff's table draws Shiki's tokens without a code block. Typeset reuses the same rule inside its existing scope, preserving dark-mode switching for the standalone stylesheet and forshiki+typesetwithcode: false. It's the same rule as before: a.darkclass above the code, or the system's dark mode with no.lightclass above it.Before/after on Drop: the same fixture rendered with
comark-ui/htmlon a dark page with typeset off. With typeset on, light and dark screenshots of the same fixture match main pixel for pixel.The new tests in
code.test.ts,diff.test.ts, andtypeset-stylesheet.test.tsfail on main and pass here.pnpm readypasses.One difference: the rule used to sit inside typeset's
@scope, so it only reached code inside a document. Now it reaches any.shikispan on a page that loads comark-code's or comark-diff's styles.