Skip to content

Commit

Permalink
Added support for GitHub-style hash fragments for dark/light images (#…
Browse files Browse the repository at this point in the history
…3857)

* feat(images): github dark mode images

closes #3856

* refactor: conbine styles
  • Loading branch information
michaelbrewer committed Apr 29, 2022
1 parent 60b8ab8 commit d8d734d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/assets/stylesheets/main/_typeset.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
6 changes: 4 additions & 2 deletions src/assets/stylesheets/palette/_scheme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit d8d734d

Please sign in to comment.