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

Themed variants of images #31

Open
KianNH opened this issue Oct 27, 2022 · 2 comments
Open

Themed variants of images #31

KianNH opened this issue Oct 27, 2022 · 2 comments

Comments

@KianNH
Copy link
Contributor

KianNH commented Oct 27, 2022

Thought I'd make an issue before opening a pull request myself to get your thoughts on a few things.

The images currently embed very nicely on the light theme, almost as if they have a transparent background.

image

When we swap to dark mode, you'll get the white background that's always been there.

image

The Material theme for MkDocs supports showing different variants of an image based on the state of the theme toggle here but that'll naturally involve a bit more maintenance burden as far as doing it retroactively and doing it in the future.

Is this something that the team is open to? Happy to contribute myself but don't want to jump into it if it's not something that you'd like to do.

As a side note, I think some of the images could benefit from zoom functionality - such as the one on the memory efficiency page.

image

I'm not too sure if it supports animated images though so that's probably worth a different issue.

@jseldess
Copy link
Contributor

jseldess commented Nov 8, 2022

So sorry for the delay, @KianNH. And thank you very much for the interest in improving our docs!

Yes, I think it'd be great to customize images based on the light/dark mode state. Would very much welcome support there. In some cases, I imagine a transparent background would allow us to use a single image for both states?

@KianNH
Copy link
Contributor Author

KianNH commented Nov 9, 2022

Yeah, I think transparent background would go a long way for the vast majority of them.

Images that have black text would still be super difficult to read on the grey background of the dark mode - vice versa if it was grey text on the white background of light mode - so they’ll want a new variant with different text.

I'll have a play with some options and post them here.

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

No branches or pull requests

2 participants