Home > Designing, Others > You Can’t Detect A Touchscreen

You Can’t Detect A Touchscreen

October 22nd, 2016 Leave a comment Go to comments

Stu Cox explains that there are a ton of ways you might think you can get a yes-or-no answer on whether a browser supports touch or not:

  • Width media queries
  • Touch-related DOM events
  • Touch-related APIs
  • Pointer media queries

The normal refrain around this is “there are devices that are both, so you’d be wrong on those,” which is true, but it’s actually more problematic than that. These testing methods are often just straight up wrong.

So:

For layouts, assume everyone has a touchscreen. Mouse users can use large UI controls much more easily than touch users can use small ones. The same goes for hover states.

For events and interactions, assume anyone may have a touchscreen. Implement keyboard, mouse and touch interactions alongside each other, ensuring none block each other.

Direct Link to ArticlePermalink


You Can’t Detect A Touchscreen is a post from CSS-Tricks

Categories: Designing, Others Tags:
  1. No comments yet.
  1. No trackbacks yet.
You must be logged in to post a comment.