zeon-studio / hugoplate

Hugoplate is a free starter template built with Hugo and TailwindCSS that will save you hours of work.
https://zeon.studio/preview?project=hugoplate
MIT License
798 stars 218 forks source link

Dark/Light Mode Images Outside Header/Footer #143

Open espinlove opened 3 weeks ago

espinlove commented 3 weeks ago

Ideally, I would like to be able to include images in the body of the website that are dependant on the dark/light mode.

At the very least, I would like to be able to include another dark/light mode image in the footer as well as have a dark/light mode banner image.

My apologies, I am a relative novice when it comes to this kind of website development so I'm not yet able to describe problems using technical terminology...

I guess this comes down to three things:

Problem 1: Using existing layout .html definitions - My first thought was to use something similar to header.html where the navbar {{ partial "logo" }} is used. I assume this partial is something inbuilt but I can't find any useful documentation on the usage (other than amending the logo.html which doesn't exist here).

Problem 2: Determining dark/light mode status - I have also found documentation on this issue but it is dependant on the user's system setting as opposed to the dark/light mode "switch". I understand that, for example, in the page-header.html the class="from-body to-theme-light dark:from-darkmode-body dark:to-darkmode-theme-light ..... etc" is how it is determined. However, it seems to be implemented quite differently than other dark/light switching.

Problem 3: Generic setting - I can see that it is possible to have dark/light mode images in general. I can't see how this would be done in the body text, though the above 2 points probably demonstrate why!

Thank you, in advance, for any help.