Post

Ever wanted to display different images in your GitHub READMEs depending on light or dark mode? 🌓 Check out the steps in this thread! 👇 #opensource #oss #floss #foss #github

You can append "#gh-light-mode-only" or "#gh-dark-mode-only" to your image URLs in Markdown. This will ensure only one image is displayed, depending on whether the viewer is in light or dark mode.

Why? Because GitHub’s CSS rules check the href for these anchor tags behind the scenes to decide which image or link to display.

0 reposts0 likes