mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 10:23:11 +00:00
Add dark- and light-mode image modifiers for custom MkDocs themes (#5318)
## Summary Roughly following the docs [here](https://squidfunk.github.io/mkdocs-material/reference/images/#custom-light-scheme). Closes #5311.
This commit is contained in:
parent
e0e1d13d9f
commit
50f0edd2cb
1 changed files with 20 additions and 0 deletions
|
@ -64,3 +64,23 @@
|
|||
--md-typeset-table-color: hsla(0, 0%, 100%, 0.12);
|
||||
--md-typeset-table-color--light: hsla(0, 0%, 100%, 0.035);
|
||||
}
|
||||
|
||||
[data-md-color-scheme="astral-light"] img[src$="#only-dark"],
|
||||
[data-md-color-scheme="astral-light"] img[src$="#gh-dark-mode-only"] {
|
||||
display: none; /* Hide dark images in light mode */
|
||||
}
|
||||
|
||||
[data-md-color-scheme="astral-light"] img[src$="#only-light"],
|
||||
[data-md-color-scheme="astral-light"] img[src$="#gh-light-mode-only"] {
|
||||
display: inline; /* Show light images in light mode */
|
||||
}
|
||||
|
||||
[data-md-color-scheme="astral-dark"] img[src$="#only-light"],
|
||||
[data-md-color-scheme="astral-dark"] img[src$="#gh-light-mode-only"] {
|
||||
display: none; /* Hide light images in dark mode */
|
||||
}
|
||||
|
||||
[data-md-color-scheme="astral-dark"] img[src$="#only-dark"],
|
||||
[data-md-color-scheme="astral-dark"] img[src$="#gh-dark-mode-only"] {
|
||||
display: inline; /* Show dark images in dark mode */
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue