r/javascript • • Jun 18 '20

Don't model dark mode with a boolean

https://dev.to/sebastienlorber/insight-4-don-t-model-dark-mode-with-a-boolean-ol1
2 Upvotes

15 comments sorted by

View all comments

6

u/Snapstromegon Jun 18 '20

First, I think this post belongs in r/webdev, because it's mainly about CSS and second I disagree with the author on his negation point. Best would be to use default styling and to use media queries to alter that default. That way you also support browser without support for those queries.

1

u/sebastienlorber Jun 18 '20

I probably didn't explain well my thoughts, but what I talk about is not specifically related to css.

More context here, where I try to find the best config option for a popular static site generator for documentation. https://github.com/facebook/docusaurus/pull/2939

In such context it's important to get the api right if we don't want to introduce breaking changes in the future to all our users.

1

u/Snapstromegon Jun 18 '20

In that case yes, it also includes JS. Nevertheless I think r/webdev would've been a better place for this.