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

17

u/occsceo Aug 21 '18

wait...wait...wait. how new is this? anyone have this running in a production app?

2

u/kevinkace Aug 22 '18

Definitely have used them. Check https://www.guildwars2.com/path-of-fire

1

u/totomo26 Aug 22 '18

Did you work on that website? If yes, what's with those weird class names?

1

u/kevinkace Aug 22 '18

Yup, I am the creator of that site 😀

We use modular-css a lot here, the class names are prefixed with a hash of the file path so they are namespaced.

1

u/totomo26 Aug 22 '18

Oh nice. Cool website by the way.

1

u/kevinkace Aug 22 '18

Thank you!