Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Closed
j9ac9k wants to merge 1 commit into matplotlib:main from j9ac9k:fix-28308

Conversation

Copy link

@j9ac9k j9ac9k commented May 27, 2024
edited
Loading

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.

Copy link

@github-actions github-actions bot left a 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.
@j9ac9k j9ac9k changed the title (削除) Have inheritance diagrams have a dark mode (削除ここまで) (追記) DOC: Have inheritance diagrams have a dark mode (追記ここまで) May 27, 2024
Copy link
Member

Would it be better to bring this upstream into pydata-sphinx-theme?

Copy link
Author

j9ac9k commented May 27, 2024
edited
Loading

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.

Copy link
Member

timhoffm commented May 27, 2024
edited
Loading

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.

j9ac9k reacted with heart emoji

Copy link
Author

j9ac9k commented May 27, 2024
edited
Loading

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.

timhoffm reacted with thumbs up emoji

Copy link
Member

story645 commented May 27, 2024
edited
Loading

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!

Copy link
Author

j9ac9k commented May 29, 2024

This has been merged upstream at the pydata-sphinx-theme, closing out this PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@github-actions github-actions[bot] github-actions[bot] left review comments

Assignees
No one assigned
Projects
Status: Waiting for author
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

[Doc]: Inheritance Diagrams Not Respecting Dark Mode

AltStyle によって変換されたページ (->オリジナル) /