fix(ui): 44px touch targets on narrow and coarse-pointer viewports
This commit is contained in:
1 parent
94cb569f01
commit
765b260e58
2 files changed
+22
-1
No files matched your search
@@ -254,6 +254,27 @@
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
/* Fingers need 44px targets (WCAG 2.5.5). Min sizes rather than heights, so
|
||||
a component's own sizing still applies wherever it is already larger,
|
||||
and inline links in prose are unaffected because min sizes do not apply
|
||||
to inline boxes. */
|
||||
@media (pointer: coarse), (width < 48rem) {
|
||||
:where(
|
||||
button,
|
||||
a[href],
|
||||
summary,
|
||||
select,
|
||||
textarea,
|
||||
input:not([type="checkbox"], [type="radio"], [type="hidden"]),
|
||||
[role="button"],
|
||||
[role="tab"],
|
||||
[role="menuitem"],
|
||||
[role="option"]
|
||||
) {
|
||||
min-height: 44px;
|
||||
min-width: 44px;
|
||||
}
|
||||
}
|
||||
/* An accessibility invariant, not a nicety: nothing animates for someone
|
||||
who has asked it not to. */
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
|
||||
Reference in new issue
Block a user