RE: Implementing Dark Mode in GatsbyJS with Styled Components and CSS Variables

avatar

You are viewing a single comment's thread:

Thank you for this post. I am going to have to do this eventually for one of my react apps, and you've given me an idea on how to do it. It's not quite the same as your idea, but I think it might work.

Thanks for posting in the programming community!



0
0
0.000
1 comments
avatar

I am glad you found it helpful in some way. Yeah, getting rid of the ssr part if it's pure React, but the css variables approach makes it really easy to mantain and make changes. Although I'm not sure I'll always go with this approach in a regular react app, instead of just passing the theme by context down the component tree.

Thanks to you for actually reading the thing! Is nice to get upvotes and tips(and appreaciated btw) but having someone to actually read and find some value in what you share is really cool.

0
0
0.000