-
-
Notifications
You must be signed in to change notification settings - Fork 8k
DOC: Have inheritance diagrams have a dark mode #28309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@github-actions
github-actions
bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for opening your first PR into Matplotlib!
If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks.
You can also join us on gitter for real-time discussion.
For details on testing, writing docs, and our review process, please see the developer guide
We strive to be a welcoming and open project. Please follow our Code of Conduct.
Fixes matplotlib#28308 The CSS integrates with the pydata-sphinx-theme to detect if the dark mode is enabled or not. If enabled, it applies the filters, to make the image conform to dark mode. Unfortunately the background is not transparent, and the color is not right in dark mode on firefox or chrome based browsers, although it looks correct on Safari.
Would it be better to bring this upstream into pydata-sphinx-theme?
Would it be better to bring this upstream into pydata-sphinx-theme?
This would likely be the ideal outcome IMO. There have been references to this being an issue in comments within their issue tracker, and some comments of other CSS that make the output better, but as far as I can tell, there hasn't been interest from their maintainers to merge into the theme itself. Lastly, I'm not sure how to go about making this contribution to the theme myself (I am not familiar with how the theme does CSS embedding, as I have little familiarity with web/css/html practices).
I got this working for pyqtgraph, and figured I would contribute more or less the same diff here.
pydata-sphinx-theme has dedicated css for sphinx extensions. Your change should likely go into its own file here:
https://github.com/pydata/pydata-sphinx-theme/tree/main/src/pydata_sphinx_theme/assets/styles/extensions
probably _graphviz.scss
because sphinx.ext.inheritance_diagram
uses sphinx.ext.graphviz
internally, and you are only modifying the output of graphviz.
Thanks for the pointer, I'll submit a PR there later today and see what they think.
The other reason I'm a bit hesitant regarding this getting merged upstream is some of those filter parameters I think look good, but feels like I may be forcing my opinions on everyone that uses the theme there; but if they come up with better filter arguments that would be better for everyone involved.
EDIT: created pydata/pydata-sphinx-theme#1834 Thanks again for the pointer, let's see what they say upstream.
EDIT: created pydata/pydata-sphinx-theme#1834 Thanks again for the pointer, let's see what they say upstream.
If it can't get merged upstream (🤞 that it does) then I think for us it should go to https://github.com/matplotlib/mpl-sphinx-theme
ETA: Thanks for cross posting the fix here!
This has been merged upstream at the pydata-sphinx-theme, closing out this PR!
Uh oh!
There was an error while loading. Please reload this page.
PR summary
closes #28308
The CSS integrates with the pydata-sphinx-theme to detect if the dark mode is enabled or not. If enabled, it applies the filters, to make the image conform to dark mode.
PR checklist
EDIT: sorry for the force-pushes, a solution to the shortcoming in the CSS code I had was provided after I submitted the PR, I've updated it accordingly.