Artboard 16Google Sheets iconSwift icon
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.

Was this snippet helpful?
Yes? Cool! You might want to check out Web Weekly for more snippets. The last edition went out 4 days ago.

Related Topics

Related Articles