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() and darkMode.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.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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.