fix(desktop): table first column no longer goes dark in light mode#178
Merged
Conversation
The imported Nord theme stripes table columns via `.milkdown-theme-nord.prose :where(td, th):nth-child(odd)` and flips that background to gray-900 under the OS `@media (prefers-color-scheme: dark)`. Our app theme is class-driven (light/dark/sepia), not OS-driven — so on a dark-mode Mac with the app in light theme, the odd (first) column rendered gray-900 with our dark text = an unreadable dark column. Nord's rule (specificity 0,3,0) also out-specified our `.milkdown .editor th` (0,2,1). Re-assert table cell backgrounds + row borders from our --mk-* theme variables at specificity (0,3,1) so tables follow the chosen app theme, not the OS: header cells keep --mk-bg-elevated, body cells are transparent, no per-column striping. Correct in light, dark, and sepia regardless of the OS setting. Co-Authored-By: Claude Opus 4.8 (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 dark-mode Mac with the app in light theme, rendered Markdown tables showed a dark, unreadable first column (and "Layer"-style header cell), while the rest of the table was light.
Root cause
The imported Nord theme (
src/index.css@import "@milkdown/theme-nord/style.css") stripes table columns and flips them dark via the OS color scheme:Our theming is class-driven (
html.theme-dark/theme-sepia), not OS-driven. So when OS=dark but app=light, the odd (first) column becamegray-900under our dark text → unreadable. Nord's selector (specificity0,3,0) also out-specified our.milkdown .editor th(0,2,1).Fix
Re-assert table backgrounds + row borders from our
--mk-*theme variables at specificity(0,3,1)so tables follow the app theme, not the OS:th) keep--mk-bg-elevatedtd) are transparentCorrect in light / dark / sepia regardless of the OS appearance.
Verification
CSS-only. The failing condition (OS dark + app light) isn't reproducible in a headless preview, so this relies on the specificity trace above + the frontend CI build + on-device check on a dark-mode Mac.
🤖 Generated with Claude Code