Dark mode image source switch? #1084
-
I tried: <img
:src="document.documentElement.classList.contains('dark') ? $withBase('/images/hero.dark.svg') : $withBase('/images/hero.svg')"
alt="Logo"
loading="lazy"
> on a markdown page and GitHub CI (with
Is there a quick fix to this? |
Beta Was this translation helpful? Give feedback.
Answered by
Mister-Hope
Sep 12, 2022
Replies: 1 comment
-
Use md-enhance plugin. It has a feature called image mark. https://vuepress-theme-hope.github.io/v2/md-enhance/guide/image.html#image-mark |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Mister-Hope
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use md-enhance plugin. It has a feature called image mark.
https://vuepress-theme-hope.github.io/v2/md-enhance/guide/image.html#image-mark