Light and dark mode images not working #5596
Replies: 2 comments 8 replies
-
It's likely related to a recent update which fixed some edge cases when using custom colors. Please try to apply the following changes, as mentioned in our documentation: [data-md-color-scheme="custom-light"] img[src$="#only-dark"]
[data-md-color-scheme="custom-light"] img[src$="#gh-dark-mode-only"] {
display: none; /* Hide dark images in light mode */
}
[data-md-color-scheme="custom-dark"] img[src$="#only-light"],
[data-md-color-scheme="custom-dark"] img[src$="#gh-light-mode-only"] {
display: none; /* Hide light images in dark mode */
} |
Beta Was this translation helpful? Give feedback.
-
I'm having the same issue as well. I've tried following the documentation for custom scheme colors. However, when in light mode, both light and dark images are displayed. When in dark mode, only one image is displayed as expected. What's interesting is when I deploy the site on GitHub by using Material for MkDocs (Insiders), both images are displayed when in light mode. But when I build the site locally by using Material for MkDocs (non-Insiders), only one image is displayed in both light and dark mode as expected. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
We are trying to apply light and dark mode images to our docs as said in the documentation but something is failing in the light mode. We tried to follow the docs because we use a custom color palette, but nothing changes. Before updating mkdocs to 1.4.3 (from version 1.3.1) it works correctly.
Do you have any idea what is happening?
Thank you very much!
Repo: https://github.com/JoaquinAmatRodrigo/skforecast
Docs: https://skforecast.org/
New requirements_docs.txt:
README.md:
mkdocs.yml:
extra.css:
Beta Was this translation helpful? Give feedback.
All reactions