markup icon indicating copy to clipboard operation
markup copied to clipboard

Adding links to images that can change based on the theme

Open JeanxPereira opened this issue 1 year ago • 0 comments

I would like to implement an image that changes according to the GitHub theme and has an embedded link. Is there a way to achieve this? Like the example below:

<picture align="center">
  <source media="(prefers-color-scheme: dark)" srcset=".github/preview.png">
  <source media="(prefers-color-scheme: light)" srcset=".github/preview-light.png">
  <a href="LINK-HERE">
    <img alt="project" src=".github/preview.png">
  </a>
</picture>

JeanxPereira avatar Jan 31 '24 19:01 JeanxPereira