Menu

Twenty-two of the thirty-six tap targets on our mobile homepage are 20 pixels tall, and the page passes WCAG anyway
📰

Twenty-two of the thirty-six tap targets on our mobile homepage are 20 pixels tall, and the page passes WCAG anyway

DEV Community: css·Daniel Pertu·12 days ago
#4pjc6x74
#devtocss#devto#dev#pixels#targets
Reading 0:00
15s threshold

WCAG 2.5.8 Target Size (Minimum) asks for 24 by 24 CSS pixels, and it is an AA criterion, which means it is the bar most teams actually hold themselves to. I measured every interactive element on eleven pages of PubTrivia at a 390 pixel viewport expecting to find a pile of failures. I found 22 targets that are 20 pixels tall on the homepage alone, and zero failures. The gap between those two sentences is the whole point of this post.

The sweep

Chrome with Emulation.setDeviceMetricsOverride at 390 by 844, device scale factor 3, mobile flag on. For every a , button , input , select , textarea , [role=button] and summary with a non-zero box, I took getBoundingClientRect() , then for each undersized target measured the centre to centre distance to its nearest neighbour.

Heights on the homepage , as a histogram:

20px x 22 21px x 1 22px x 1 26px x 1 36px x 2 44px x 5 128px x 1 151px x 3

Enter fullscreen mode

Exit fullscreen mode

Thirty-six targets. Twenty-four of them are under 24 pixels in one dimension.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.