14 Best CSS Dark Mode

This article provides a collection of CSS demos for dark mode. Hand-picked free CSS Dark mode and light mode toggle functionality using HTML, jQuery, SCSS, Materialize, React, CSS. This collection of demos is a great resource for anyone looking to create a dark mode on their website. I hope you will find these examples helpful. I have included them in order to help you get started on implementing your own dark mode stylesheet for your own project. Updated with 3 items on Oct 13, 2021.

Author

  • Jon Kantner
  • May 12, 2020

Made with

  • HTML / CSS

About the Code

Light/Dark Mode Toggle With Curtain Effect

A light and dark switch where the handle bounces into place while a curtain inverts the scheme.

More info: Link

Dependency:


Author

  • Jon Kantner
  • October 16, 2020

Made with

  • HTML / Sass / JS

About the Code

Neumorphic Light Switch

The brightness and thumb light are adjusted through dynamically changed CSS variables.

More info: Link

Dependency:


Author

  • Bruno Massa
  • July 17, 2018

Made with

  • HTML / CSS / JS

About the Code

Day Night switch #codepenchallange

A simple day night switch.

More info: Link

Dependency: jquery.min.js


Author

  • Kevin McCormack
  • February 3, 2017

Made with

  • HTML / SCSS / JavaScript

About the Code

Dark -Light Mode Switcher

More info: Link

Dependency:

Author

  • Demilade Olaleye
  • March 10, 2019

Made with

  • HTML / CSS

About the Code

Pure CSS dark mode toggle switcher

More info: Link

Dependency:

Author

  • John Riggles
  • August 24, 2020

Made with

  • Slim / SCSS

About the Code

Dark Mode Toggle

More info: Link

Dependency:

Author

  • Jay Holtslander
  • April 11, 2019

Made with

  • HTML / SCSS / JavaScript

About the Code

Materialize – CSS Dark Mode

More info: Link

Dependency:

Author

  • Rico Mossesgeld
  • March 2, 2017

Made with

  • HTML / SCSS / JavaScript

About the Code

CSS + jQuery Night Mode Toggle

Night mode toggle button demo that targets a specific container.

More info: Link

Dependency: jquery.min.js

Author

  • Aris Acoba
  • May 24, 2020

Made with

  • Pug / SCSS / JavaScript

About the Code

Instagram CSS Dark Mode

TIL that you can use data-attributes as CSS selectors. Here’s an exploration of Instagram’s dark mode implementing that

More info: Link

Dependency: sanitize.min.css

Author

  • tris timb
  • March 28, 2018

Made with

  • HTML / SCSS / JavaScript

About the Code

Light and dark page toggle

More info: Link

Dependency: jquery.min.js

Author

  • Dmitriy Levchenko
  • May 18, 2020

Made with

  • Pug / SCSS / JavaScript

About the Code

React

More info: Link

Dependency:

Author

  • Michael Richins
  • October 10, 2019

Made with

  • HTML / SCSS / JavaScript

About the Code

Light & Dark Mode

CSS Media Query prefers-color-scheme. At the time of the creation of this post, only Firefox v.68 supports this media query. The prefers-color-scheme CSS 5 Media Query is used to detect if the user has requested the system to use a light or dark color theme. This Pen demonstrates how to use a theme toggle for both legacy and progressive code. If the theme is overwriten by the toggle, it will be persisted via local storage; else the media query will keep that setting. Press the following button to clear that storage.

Note: Chrome 76 and Edge 76 now support this feature

More info: Link

Dependency:

W3TWEAKS
Latest posts by W3TWEAKS (see all)

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *