1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-09-24 11:28:23 +02:00

Added support for GitHub-style hash fragments for dark/light images (#3857)

* feat(images): github dark mode images

closes #3856

* refactor: conbine styles
This commit is contained in:
Michael Brewer 2022-04-29 10:05:19 -07:00 committed by GitHub
parent 60b8ab8703
commit d8d734d306
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -416,7 +416,8 @@ kbd {
}
// Hide images for dark mode
img[src$="#only-dark"] {
img[src$="#only-dark"],
img[src$="#gh-dark-mode-only"] {
display: none;
}

View File

@ -97,12 +97,14 @@
}
// Hide images for light mode
img[src$="#only-light"] {
img[src$="#only-light"],
img[src$="#gh-light-mode-only"] {
display: none;
}
// Show images for dark mode
img[src$="#only-dark"] {
img[src$="#only-dark"],
img[src$="#gh-dark-mode-only"] {
display: initial;
}
}