-
Notifications
You must be signed in to change notification settings - Fork 18
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
Book theme options to specify theme and disable theme toggle button #522
base: main
Are you sure you want to change the base?
Conversation
|
Hi @gvarnavi, Thank you for opening this PR! Theme selectors are an important part of accessibility (though there is nuance to that point). Is there a particular reason that you want to disable this preference for your users of the theme? |
Thanks for the prompt reply @agoose77 ! The real use case is that I started modifying the book-theme to achieve a stripped-down "presentation-like" look, similar to what I've been using with Observable Framework. template: book-theme
options:
logo: ./figures/logo.svg
logo_dark: ./figures/logo_dark.svg
hide_outline: true
hide_title_block: true
hide_search: true But wanted more customization to completely style/disable the header, hence the As for locking in the theme, we use a lot of interactive matplotlib figures for the Elemental Microscopy journal, which are challenging to have support both light/dark themes both when static (we should at the very least add a I appreciate the accessibility point, but that requires a level of sophistication I don't think is currently easy to support for interactive figures (in contrast e.g. to MyST tables, which look great in both). Thanks again for looking into this! |
Thanks for the quick reply @gvarnavi. It took me a bit longer to circle round here than usual. The question around removing accessibility from the user is tricky, and I don't have all the answers. I can see why it is useful for your use case! I'll bring this up at our developers meeting. |
I wanted to quickly follow-up on this. I just gave a conference talk using a slightly-modified book-theme found here: https://github.com/gvarnavi/custom-myst-book-theme. It was very well received and I'd be happy to prototype this further if you think that would be useful to contribute a |
Adds the following two options to the book-theme:
theme
can either be 'light' or 'dark' and forces the initial theme (as opposed to using local storage)hide_theme_toggle
is a boolean and disables the top-right theme toggle