r/javascript • • 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

114 comments sorted by

View all comments

65

u/PortablePawnShop Aug 21 '18

Holy shit, I've been doing absurdly complicated workarounds for some of this

5

u/IIIIRadsIIII Aug 22 '18

What’s a good use case for this?

8

u/flaiks Aug 22 '18

hmm I would say rendering different component sets for mobile/desktop ?