Allow paragraph elements to inherit color #1762
Merged
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.
As #741 describes, we make notebook cell outputs "white-ish" even when our theme is in dark mode because dark mode isn't well supported by the tools that render notebook cell outputs to HTML.
However, our theme also sets the font color of
p
elements to a CSS variable that changes depending on whether the theme is set to light or dark mode.These two things combined to create a bug, by layering the following colors on top of each other:
This made some of the text on notebook cell outputs invisible in dark mode. Here is a pair of before and after screenshots:
Notice the text in the lower left that reads "100 rows × 26 columns"? That text is contained in a p-tag.
This PR removes the CSS
color
rule on thep
selector so that the paragraph can inherit its color from the nearest parent element that has it set.I think this change makes sense because both
body { color }
andp { color }
are (before this PR) set to the same CSS variable,var(--pst-color-text-base)
. In the past, the paragraph color was set to a different CSS color variable, which was probably done to allow theme consumers to style copy color separate from the color of other text on the site, but since that distinction has since been removed, I don't think it makes sense to setp { color }
explicitly. Just let it inherit.