Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
📝 Document the light and dark image variants
Browse files Browse the repository at this point in the history
hayesall committed Oct 22, 2023
1 parent 658699f commit b210655
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions guide/src/format/markdown.md
Original file line number Diff line number Diff line change
@@ -117,19 +117,20 @@ Which, of course displays the image like so:

![The Rust Logo](images/rust-logo-blk.svg)


## Light and Dark Image Variants

Separate light mode and dark mode images may be presented to the viewer by adding `#light-only` or `#dark-only` to an image path:

```markdown
<img src="images/rust-logo-blk.svg" class="no-dark-themes" />
<img src="images/rust-logo-blk-dark.svg" class="no-light-themes" />
![rust logo standard edition](images/rust-logo-blk.svg#only-light)
![rust logo dark mode](images/rust-logo-blk-dark.svg#only-dark)
```

Try switching the theme to see the effect below (brush icon at the top left of the page):

<img src="images/rust-logo-blk.svg" class="no-dark-themes" />
<img src="images/rust-logo-blk-dark.svg" class="no-light-themes" />
![rust logo standard edition](images/rust-logo-blk.svg#only-light)
![rust logo dark mode](images/rust-logo-blk-dark.svg#only-dark)

## Extensions

0 comments on commit b210655

Please sign in to comment.