---
title: "Discussion on \"How to detect dark mode using JavaScript\" | Hashnode"
description: "Discussion on \"How to detect dark mode using JavaScript\". Detect dark mode with JavaScript and CSS media queries via `window.matchMedia()`, improving user experience and minimizing eye-strain"
url: "https://hashnode.com/posts/how-to-detect-dark-mode-using-javascript/646c41d31520763b8fa92560"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to detect dark mode using JavaScript](https://blog.1links.app/how-to-detect-dark-mode-using-javascript?utm_source=hashnode&utm_medium=feed)

Detect dark mode with JavaScript and CSS media queries via \`window.matchMedia()\`, improving user experience and minimizing eye-strain

May 23, 2023 · 3 min read · blog.1links.app  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#html5](https://hashnode.com/tag/html5)
-   [#css](https://hashnode.com/tag/css)
-   [#nodejs](https://hashnode.com/tag/nodejs)
-   [#web-development](https://hashnode.com/tag/web-development)

## Written by

[The Future Programmer](https://hashnode.com/@1linksapp)

@1linksapp

  
[View profile](https://hashnode.com/@1linksapp)

Software Developer @1linksapp

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
