Skip to content
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

Dark and Light mode for logo on Navbar #2516

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

UtkarshMishra12
Copy link

I've taken a reference from this website in order to support the logo in dark mode.

I did not manage to build this locally but hopefully, the CI will correctly.

Signed-off-by: Utkarsh Mishra <nasautkarsh@gmail.com>
@rossant
Copy link
Member

rossant commented Aug 18, 2023

(Note: this is part of the EuroSciPy 2023 sprint with @rougier and I)

Signed-off-by: Utkarsh Mishra <nasautkarsh@gmail.com>
Copy link
Member

@djhoese djhoese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for trying to tackle this. I've made an inline comment for the changes needed to make this hopefully work.

Comment on lines +206 to +209
html_theme_options = {
"light_logo": "logo-light-mode.png",
"dark_logo": "logo-dark-mode.png",
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation you linked to for implementing this was for the "Furo" sphinx theme which we aren't using. We are using the pydata sphinx theme which has documentation for doing light/dark logos here:

https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/branding.html#different-logos-for-light-and-dark-mode

You'll need to change this to match. Additionally you are overwriting the html_theme_options dictionary. You'll need to move these change to the existing html_theme_options dictionary (starting on line 185). Similarly, the html_static_path is already defined a couple lines below your changes.

@djhoese
Copy link
Member

djhoese commented Aug 18, 2023

Also note I think you can turn off building the gallery of examples with:

cd doc
make html_dev-pattern PATTERN="abcd"

This will only generate the examples matching "abcd" in the filename which should be none of them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants