Ronalds Vilciņš

Interaction media features

You can detect touch screens, stylus-based screens or touchpads.

/* Make radio buttons and check boxes larger if we have an inaccurate primary pointing device */
@media (pointer:coarse) {
  input[type="checkbox"], input[type="radio"] {
    min-width:30px;
    min-height:40px;
    background:transparent;
  }
}

The pointer media feature has three values: fine, coarse, and none.

You can also use the any-pointer media feature to apply styles for any device that has a pointing device, regardless of the device’s level of granularity.

@media (any-pointer: fine) {
  /* Style rules for devices with a pointing device, regardless of granularity */
}