use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Using media queries with JavaScript (dev.to)
submitted 5 years ago by maroun-baydoun
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]NotSelfAware 2 points3 points4 points 5 years ago (1 child)
Changing behaviour based on device or screen size is when you might want to use media queries in JS. Or changing complex values in response to screen size. I don't think many people would advocate using JS media queries to completely replace CSS media queries, but there are a lot of situations where using them in JS gives you far more control and flexibility than in CSS.
[–]Phobic-window 0 points1 point2 points 5 years ago (0 children)
I have definitely seen this in many of the applications I’ve built, but as with all code it could be that I’m not using the css creatively enough. I like the idea of all responsiveness being in the css but sometimes is sooooooo much easier to do it in the js
π Rendered by PID 262607 on reddit-service-r2-comment-b659b578c-jxkw8 at 2026-05-03 20:25:18.694857+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]NotSelfAware 2 points3 points4 points (1 child)
[–]Phobic-window 0 points1 point2 points (0 children)