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

Add classes for multi-theme content support #673

Merged
merged 2 commits into from May 23, 2022

Conversation

12rambau
Copy link
Collaborator

@12rambau 12rambau commented May 21, 2022

FIx #658

As suggested by @choldgraf, The theme is now allowing the devs to use only-dark and only-light to use different images based on the selected mode.

It works with any elements (I'll use it for example to render multiple instance of jupyterlite in one of my documentation). Thus it's not documentated in images section but in the customization section.

Let me know if you think about any loopholes.

PS: the doc demo: https://pydata-sphinx-theme--673.org.readthedocs.build/en/673/user_guide/customizing.html#use-specific-content-in-each-theme

@12rambau 12rambau marked this pull request as ready for review May 21, 2022 16:16
@choldgraf
Copy link
Collaborator

This is looking great to me - one quick idea, though I think it'd be ok to move this to another PR: I think the most common image people will want to use for this is the logo in the top left. So I wonder if we could support another top-level config like "html_logo_dark", and place this next to the current logo, and add the respective theme selectors. That would allow users to have light and dark logos

@12rambau
Copy link
Collaborator Author

I was thinking about that as well but I think it deserves it's own PR if you could open another issue and assign it to me so that I don't forget that would be perfect

@12rambau 12rambau changed the title multi-theme images support multi-theme content support May 21, 2022
@choldgraf
Copy link
Collaborator

Done here: #674 !

Copy link
Collaborator

@choldgraf choldgraf left a comment

Choose a reason for hiding this comment

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

I cleaned up the explanation a little bit - I hope that's OK!

It looks good to me though 👍

@choldgraf
Copy link
Collaborator

Hmm can we choose a different sample image? The daily-cat image doesn't seem to resolve anymore: https://source.unsplash.com/200x200/daily?cute+cat

@jarrodmillman
Copy link
Collaborator

Hmm can we choose a different sample image? The daily-cat image doesn't seem to resolve anymore: https://source.unsplash.com/200x200/daily?cute+cat

It appears to work for me.
screenshot
screenshot

@choldgraf
Copy link
Collaborator

huh weird - maybe my internet was just messing up...OK then I think we are good to go here :-)

@choldgraf choldgraf changed the title multi-theme content support Add classes for multi-theme content support May 23, 2022
@choldgraf choldgraf merged commit 479dff7 into pydata:master May 23, 2022
@12rambau 12rambau deleted the image_class branch May 23, 2022 18:25
@jarrodmillman jarrodmillman added this to the 0.9 milestone May 25, 2022
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.

Support for only-light and only-dark classes
3 participants