fix(ui): restore dark-mode contrast for prose table headers - #330
Merged
Conversation
Table headers rendered near-black on near-black wherever markdown goes through the shared MarkdownProse — most visibly on Search, where results expand into SEC narrative sections and XBRL text blocks that are full of tables. The typography plugin colors `thead th` from its `--tw-prose-headings` variable, and that selector outranks any element rule this config could set, so the element-by-element dark variant never reached a header cell while the variable kept its light-mode default of near-black. Override the `--tw-prose-*` variables the way `prose-invert` does. That also covers the variable-driven elements this dark variant never had rules for at all: list markers, hr, captions, kbd, and table borders.
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.
Table headers rendered near-black on near-black wherever markdown goes through
the shared
MarkdownProse— most visibly on Search, where results expandinto SEC narrative sections and XBRL text blocks that are full of tables.
Same fix as robosystems-app#351, which is where it was first spotted (in the
document viewer). This app was worse off: its
typography.darkblock stoppedat
blockquote, with no table, marker orhrrules at all.Cause
The typography plugin colors
thead thfrom its--tw-prose-headingsvariable:
That selector outranks any
theadelement rule this config could set, so anelement-by-element dark variant can never recolor a header cell — while the
variable itself kept its light-mode default of near-black.
Fix
Override the
--tw-prose-*variables in the dark variant, the wayprose-invertdoes, instead of chasing elements. Verified in the compiled CSS:.dark\:prose-dark:is(.dark *)now emits--tw-prose-headings: #F9FAFBand,at specificity (0,2,0), beats the base
.prose(0,1,0) that set it near-black.The variable values match this config's existing element rules, so nothing else
changes visually, and light mode is untouched. It also covers the
variable-driven elements this dark variant had no rules for at all: list
markers,
hr, captions,kbd, and table borders.npm run test:allgreen (368 tests).