1
0
mirror of synced 2025-12-21 19:06:49 -05:00

Add theme context for images in Markdown support (#22830)

* add theme context for images support
This commit is contained in:
Daniel Adams
2021-11-18 18:56:41 +01:00
committed by GitHub
parent 5b8cb34e4b
commit fe41d50482

View File

@@ -134,6 +134,18 @@ Here are some examples for using relative links to display an image.
For more information, see "[Relative Links](#relative-links)." For more information, see "[Relative Links](#relative-links)."
{% ifversion fpt or ghec or ghes > 3.3 or ghae-issue-5559 %}
### Specifying the theme an image is shown to
You can specify the theme an image is displayed to by appending `#gh-dark-mode-only` or `#gh-light-mode-only` to the end of an image URL, in Markdown.
We distinguish between light and dark color modes, so there are two options available. You can use these options to display images optimized for dark or light backgrounds. This is particularly helpful for transparent PNG images.
| Context | URL |
|--------|--------|
| Dark Theme | `![GitHub Light](https://github.com/github-light.png#gh-dark-mode-only)` |
| Light Theme | `![GitHub Dark](https://github.com/github-dark.png#gh-light-mode-only)` |
{% endif %}
## Lists ## Lists