Allow paragraph elements to inherit color#1762
Merged
trallard merged 2 commits intopydata:mainfrom May 8, 2024
Merged
Conversation
choldgraf
approved these changes
Apr 9, 2024
Collaborator
choldgraf
left a comment
There was a problem hiding this comment.
As long as this doesn't create unexpected side effects then this feels like a reasonable idea to me!
Collaborator
Author
c1b58be to
25838be
Compare
Collaborator
Author
|
Okay, I think this is ready for merge now. I checked lots of pages in both light and dark mode, hovered and focused on lots of elements, couldn't find any places where the styles looked wrong. |
trallard
approved these changes
May 8, 2024
ivanov
pushed a commit
to ivanov/pydata-sphinx-theme
that referenced
this pull request
Jun 5, 2024
* Allow paragraph elements to inherit color * Set paragraph color where necessary
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.

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
pelements 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
colorrule on thepselector 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.