Start with a default size. Covers unknown or unsupported cases.
Branch on fine. Slightly smaller checkbox for precise pointers.
Branch on coarse. Larger checkbox for fingers.
One primary match. A device reports one primary value, so only one branch applies.
Edge Cases & Pitfalls
If the wrong branch seems active, one of these is usually why.
primary
Only the primary pointer counts
A touchscreen laptop may report coarse even with a mouse attached. Use any-pointer when any fine device should win.
hover
Pointer is not hover
Accuracy and hover ability are different questions. Pair with hover when menus rely on hover.
size
Do not overshrink for fine
Smaller is not always better. Keep controls easy to hit; enlarge for coarse instead of squeezing fine too hard.
width
Do not infer input from viewport width
Large tablets and small laptops break width-based guesses. Prefer pointer / hover over assuming touch from screen size.
none
none is uncommon but real
Keyboard-first or some assistive setups may report none. Keep focus styles strong and do not rely on pointer-only UI.
Compatibility
Browser Support
pointer is a browser CSS media feature for primary pointing accuracy. Node.js, Deno, and Bun do not evaluate it.
✓ Baseline · Widely available since Dec 2018
pointer
Supported in Chrome 41+, Firefox 64+, Safari 9+, Edge 12+, Opera 28+, Samsung Internet 5+. Not supported in Internet Explorer.
97%Global support
Google Chrome41+
Full support
Mozilla Firefox64+
Full support
Apple Safari9+
Full support
Microsoft Edge12+
Full support
Opera28+
Full support
Samsung Internet5+
Full support
Internet ExplorerNo
Not supported
pointerWidely supported
Bottom line: Safe for production. Keep usable default sizes outside the query for older clients.
Remember
Key Takeaways
Role: reports primary pointing accuracy—fine, coarse, or none.
Common use: enlarge tap targets for coarse.
vs any-pointer:pointer is primary only; any-pointer checks all devices.
Pitfall: do not guess touch from screen width alone.
One line: use @media (pointer: coarse) to grow controls for fingers; keep defaults usable for everyone else.
Frequently Asked Questions
It reports whether the primary input includes a pointing device and how accurate that pointer is: fine (mouse), coarse (finger), or none.
fine is high accuracy (mouse, trackpad, stylus). coarse is limited accuracy (finger on a touchscreen). Coarse UIs need larger tap targets.
pointer checks only the primary pointing device. any-pointer checks every available pointer. A touch laptop may be pointer: coarse while still matching any-pointer: fine if a mouse is attached.
pointer is about pointing accuracy. hover asks whether the primary input can hover. Pair them when you need both touch targets and hover-only UI.
You can, but keep usable hit areas. Larger targets help everyone. Prefer enlarging for coarse rather than shrinking aggressively for fine.
Baseline widely available since December 2018: Chrome 41+, Firefox 64+, Safari 9+, Edge 12+. Not supported in Internet Explorer. It is a browser CSS media feature, not a Node.js API.