Published at
Updated at
Reading time
1min

This one is a real brain teaser. ๐Ÿ™ˆ

Kilian Valkhof published Detecting media query support in CSS and JavaScript and I had to read it a few times to understand its logic.

In short: that's how you can detect if a browser supports prefers-reduced-data CSS media query:

/* Apply if prefers-reduced-data is supported */
@media not all and (prefers-reduced-data), (prefers-reduced-data) {
  ...
}

In long: read Killian's post.

If you enjoyed this article...

Join 5.5k readers and learn something new every week with Web Weekly.

Web Weekly โ€” Your friendly Web Dev newsletter
Reply to this post and share your thoughts via good old email.
Stefan standing in the park in front of a green background

About Stefan Judis

Frontend nerd with over ten years of experience, freelance dev, "Today I Learned" blogger, conference speaker, and Open Source maintainer.

Related Topics

Related Articles