I recently launched my new portfolio site and I have to say, I'm super proud! My old site was built on Wix years before I learned how to code and w...
For further actions, you may consider blocking this person and/or reporting abuse
Love this tutorial, implementing my own dark mode for a simple application, so this was useful for that as well. I like the idea of using
darkMode.enable()
anddarkMode.disable()
. But I also thought about using a mode variable and assigning it 'light' and 'dark'. This way it allows me to add something like 'high-contrast-light' and 'high-contrast-dark' (more options) and potentially will scale a bit better. But tracking by the boolean makes for a simple example. Thanks for this.First of all Great Portfolio site. It is really something to be proud of...
And thanks for the great piece of information. It really makes it simple to implement dark mode....
Whoa, your site looks so good!! Love the design, the toggle between dark/light mode is super fun too.
Thanks Jess! 🙂
Hello. I want a dark mode by default, but when I use
const darkMode = useDarkMode(true)
it still keeps it to light mode by default. Any idea ?Hard to know without seeing your code, my first guess is that your ‘dark-mode’ and ‘light-mode’ classes are applying the wrong CSS. Double check which classname is being applied to the body and which css properties are attached to those classes.
Hi I've been trying to toggle the states with just one button but it doesn't seem to work, Can you help? please