Skip to content

Commit

Permalink
Updated 'The Picture element' section as per issue requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
a8h1km committed Jan 5, 2025
1 parent d25344a commit c621d09
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,15 +265,9 @@ Here are some examples for using relative links to display an image.
For more information, see [Relative Links](#relative-links).

### Specifying the theme an image is shown to
### The Picture Element

You can specify the theme an image is displayed for in Markdown by using the HTML `<picture>` element in combination with the `prefers-color-scheme` media feature. 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.

For example, the following code displays a sun image for light themes and a moon for dark themes:

{% data reusables.getting-started.picture-element-example %}

The old method of specifying images based on the theme, by using a fragment appended to the URL (`#gh-dark-mode-only` or `#gh-light-mode-only`), is {% data variables.release-phases.closing_down %} and will be removed in favor of the new method described above.
The `<picture>` HTML element is supported.

## Lists

Expand Down

0 comments on commit c621d09

Please sign in to comment.