[csswg-drafts] [mediaqueries-5] detect keyboard navigation abilities

frivoal has just created a new issue for https://github.com/w3c/csswg-drafts:

== [mediaqueries-5] detect keyboard navigation abilities ==
If `@media (pointer)`  (or `@media (any-pointer)`) evaluates to false, presumably the user is using some sort of keyboard input or similar, and pressing tab (or similar) to navigate the focusable elements in the page. Complex layouts are tedious to navigate this way, so in such situations, authors may want to switch to a simpler, linear design.

However, even if there's no pointer, if the user does have a device that is capable of spatial navigation (as discussed in https://drafts.csswg.org/css-ui-4/#nav-dir or https://github.com/lgeweb/spatial-navigation), then using a complex layout may be fine.

There's currently no media feature enabling authors to detect that.

Proposal for a new media feature:

`nav: none | sequential | spatial` (or `key-navigation` instead of `nav` if we want to be verbose)

`@media (nav: sequential)` is true if the user has a tab key or equivalent mechanism
`@media (nav: spatial)` is true if the user can navigate with arrow keys

Both can be true at the same time if the device matches.

cc @tabatkins @jihyerish 

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1911 using your GitHub account

Received on Friday, 27 October 2017 07:54:25 UTC