Replies: 1 comment
-
Instead of filtering the media query based on the users system preferences, filter it based on the toggled palette. There is an example in the docs for the custom palette: Here is an example I used in GMC's docs: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am currently using the MkDocs Material theme in my project and have configured it to support both light and dark modes as defined in my
mkdocs.yml
file. The relevant portion of the configuration is as follows:Additionally, I have added custom CSS to
extra.css
to modify the color of Header 2 (h2
) based on the color scheme preference. Here is my custom CSS:However, I've noticed an issue where these custom colors for
h2
are only applied when the system's default theme is changed. They do not switch when using the theme toggle button defined inmkdocs.yml
.I am wondering if there's a way to have this custom CSS applied correspondingly when the theme is toggled in the MkDocs Material user interface itself, instead of only following the system's default theme. I'd appreciate any guidance or potential solutions to address this issue.
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions