How to Implement Dark Mode in Your Website Using Media Queries

Envato on YouTubeWatch on YouTube

SaveMark complete

Sign in to save videos and track what you’ve finished.

IntermediateUI3 min

About this video

A short tutorial on using the CSS prefers-color-scheme media query to detect a visitor's dark mode setting and style a website accordingly. It is aimed at people who already work with HTML and CSS.

What you’ll learn

  • Detect a visitor's dark mode preference with a CSS media query
  • Apply dark mode styles to a website's pages