Media query tests - features

Back to index.

Three media queries for advanced feature detection. Very useful; can’t wait until they’re supported.

pointer

CSS4 spec

The pointer media query tells you if the pointer is coarse, fine, or entirely absent.

values

hover

CSS4 spec

The hover media query tells you if hovering is possible, impossible, or possible by some unusual interface (say, long-press).

values

scripting

CSS4 spec

The scripting media query tells you if the scripting is enabled (enabled), disabled (none), or only enabled for the initial page load (initial-only).

It should have a fourth value: server-side, for proxy browsers that do support JavaScript but require a round-trip to the server to execute it.

values

light-level

CSS4 spec

The light-level media query tells you if the light-level is enabled, disabled, or only enabled for the initial page load.

values