---
title: "Discussion on \"SVG Toggle Button Tutorial – How to Handle Dark Mode with CSS and JavaScript\" | Hashnode"
description: "Discussion on \"SVG Toggle Button Tutorial – How to Handle Dark Mode with CSS and JavaScript\". How can you detect dark mode in CSS and JavaScript? How can you manually override it with a toggle button? And how can you create a sun and moon icon with SVG?\nIn this tutorial, you will learn how to detect dark mode in CSS and JavaScript, and you wi..."
url: "https://hashnode.com/posts/how-to-handle-dark-mode-with-css-and-javascript/66c4c80b6e4b60b5b844529c"
---

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

Discussion

# [SVG Toggle Button Tutorial – How to Handle Dark Mode with CSS and JavaScript](https://freecodecamp.org/news/how-to-handle-dark-mode-with-css-and-javascript?utm_source=hashnode&utm_medium=feed)

How can you detect dark mode in CSS and JavaScript? How can you manually override it with a toggle button? And how can you create a sun and moon icon with SVG? In this tutorial, you will learn how to detect dark mode in CSS and JavaScript, and you wi...

Mar 8, 2024 · 13 min read · freecodecamp.org  
Read the article

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

## Written by

[Hunor Márton Borbély](https://hashnode.com/@hunor)

@hunor

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

Full-stack web developer, coach, posting creative coding tutorials and games on YouTube and CodePen

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
