r/javascript • u/[deleted] • Aug 21 '18
Effectively supported in all browsers, JavaScript has its own form of media queries just like CSS.
https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia
465
Upvotes
r/javascript • u/[deleted] • Aug 21 '18
10
u/DOG-ZILLA Aug 21 '18
I had been using a utility in Modernizr for years for this kinda thing before discovering match media literally the other day.
Felt great to remove another small dependency from the codebase.