---
title: "Comment by Etiene James on \"The easiest way to build a Dark Mode\" | Hashnode"
description: "Nice article. But I was like, &quot;How do a User switch between both modes?&quot;. I&#39;ll be super grateful to get an answer to that."
url: "https://hashnode.com/posts/the-easiest-way-to-build-a-dark-mode/5fd9fc744d058528f6ceee04/comment/5fda54ea33db062ae10cddf6"
---

[Discussion](https://hashnode.com/posts/the-easiest-way-to-build-a-dark-mode/5fd9fc744d058528f6ceee04)

Comment [The easiest way to build a Dark Mode](https://hashnode.com/posts/the-easiest-way-to-build-a-dark-mode/5fd9fc744d058528f6ceee04)

[Etiene James](https://hashnode.com/@St80ene)

[Dec 16, 2020](https://hashnode.com/posts/the-easiest-way-to-build-a-dark-mode/5fd9fc744d058528f6ceee04/comment/5fda54ea33db062ae10cddf6)

Nice article. But I was like, "How do a User switch between both modes?". I'll be super grateful to get an answer to that.

[Dom Habersack](https://hashnode.com/@domhabersack)

[Dec 16, 2020](https://hashnode.com/posts/the-easiest-way-to-build-a-dark-mode/5fd9fc744d058528f6ceee04/comment/5fda54ea33db062ae10cddf6#reply-5fda629dd296552b06489949)

With this approach, there is no active switch. If the operating system supports Dark Mode, the CSS respects that global setting.

Like when I go into my iPhone’s settings and switch EVERYTHING to Dark Mode (Settings.app → Display & Brightness → Appearance). macOS has a similar setting. I don’t know where to find it on Android, Windows, or Linux.

If we wanted an active toggle a visitor can use, we’d have to use JavaScript instead of (or possibly in addition to) this media query.

You can see a demo of this by switching your phone from light to dark mode on twitter.com, they seem to use this method. I added it to my site just last week: islovely.co/posts

[Etiene James](https://hashnode.com/@St80ene)

[Dec 17, 2020](https://hashnode.com/posts/the-easiest-way-to-build-a-dark-mode/5fd9fc744d058528f6ceee04/comment/5fda54ea33db062ae10cddf6#reply-5fdbea0d1485f22e24b329e5)

Thanks for taking out time to answer. I have learned a lot.
