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

Toggle which figure is shown in light/dark mode #15

Open
wviechtb opened this issue May 4, 2023 · 1 comment
Open

Toggle which figure is shown in light/dark mode #15

wviechtb opened this issue May 4, 2023 · 1 comment

Comments

@wviechtb
Copy link
Contributor

wviechtb commented May 4, 2023

Hi Amir,

Thanks again for the nice template. Just wondering: Would it somehow be possible to toggle which figure is shown in the light versus dark mode? As an example, consider this page:

https://wviechtb.github.io/metafor/reference/selmodel.html

In light mode, the figures integrate nicely, but when switching to dark mode, it doesn't look so nice. I can easily create figures with a dark background that would look nice for the dark mode, but then the toggle would also have to be able to switch which figure is shown.

I realize that this might simply not be possible via a template, so feel free to close this issue if you think this is not possible.

@amirmasoudabdol
Copy link
Owner

Hi Wolfgang! 👋🏼

I think it is possible to do it in the template, but that needs a bit of work. I was experimenting with it, but I didn't follow through. That being said, if you have two versions of the plot, you can still do it, and while I've not tested it with the manual toggle, I think it should still work.

You can see how I did it in SFThemes. Notice that if you change from light to night mode, the main plot changes subtly! You can see how it's done here.

I just realized that I even wrote about it, here. It works on RMarkdown as well, see 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