Specify different image for dark / light mode #1961
Replies: 5 comments 7 replies
-
The Hugo site generator used for Wowchemy is a static site generator, hence it's not best suited to dynamic content. It could be possible but would introduce complexity and there would be some issues to navigate such as lazy loading of dynamic content (dynamic images in this context). Feel free to propose an approach. Otherwise, other users in this position have simply disabled Day/Night mode in |
Beta Was this translation helpful? Give feedback.
-
By any chance is it a SVG image? I have not tested this but you can use I use extensively SVG images in my website and this is the only reason I haven't configured a light/dark theme (I only use a light mode) |
Beta Was this translation helpful? Give feedback.
-
It appears that Wowchemy v5.1 supports automatic inversion of images based on dark/light theme. I wonder if this can be also done for featured images and so on. |
Beta Was this translation helpful? Give feedback.
-
My use case is something like with the MongoDB logo which explicitly state which image should be use based on the background color. The dynamic I used the following method,
and
|
Beta Was this translation helpful? Give feedback.
-
Take a look at my blog post to learn how to do this. It is theme independent and doesn't need JavaScript! https://stenbrinke.nl/blog/adding-support-for-dark-and-light-images-to-hugo-figure-shortcode |
Beta Was this translation helpful? Give feedback.
-
Hello, I was wondering if there is a way to have two different versions of an image for the light and dark modes. I have some stylized images that work well with black contours that work well with the light mode, but do not match well with the dark mode.
Is there a possibility to change which image is shown in each mode?
Beta Was this translation helpful? Give feedback.
All reactions