Back to Browse

Detecting Screen Size and OS Dark Mode with matchMedia() - JavaScript Tutorial

9.8K views
Mar 5, 2020
5:12

In this video tutorial I'll be showing you how to use the matchMedia() function in JavaScript - which can be used to detect web browser screen sizes and OS dark or light mode. Support me on Patreon: https://www.patreon.com/dcode - with enough funding I plan to develop a website of some sort with a new developer experience! For your reference, check this out: https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia Follow me on Twitter @dcodeyt! If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!

Download

1 formats

Video Formats

360pmp47.1 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

Detecting Screen Size and OS Dark Mode with matchMedia() - JavaScript Tutorial | NatokHD