Give touch screens 44 px targets through the primitives

A pointer-coarse variant sits beside the pointer-fine one. Under it the
default, small and icon buttons, tab triggers, the sidebar rail rows and
the phone logo link reach the 44 px touch floor; a mouse keeps the
compact desktop density. The rail's height steps now apply to a mouse
only. A phone held sideways crosses the md breakpoint at about 390 px of
height, where the fixed footer left the list three rows: there the whole
rail scrolls as one column, without a native scrollbar.
This commit is contained in:
Marc-André Bombeck committed 2026-10-08 17:52:44 +02:00
1 parent 492c2a4131
commit 3a20f23f0f
5 files changed
+37 -8

No files matched your search

+12
View File
@@ -46,6 +46,18 @@
}
}
/*
* `pointer-coarse:` — a finger is the primary pointer. The control
* primitives (Button, tab triggers, the sidebar rail rows) grow their hit
* area to the 44 px touch floor under it, so a phone or a touch tablet gets
* reachable targets while a mouse keeps the compact desktop density.
*/
@custom-variant pointer-coarse {
@media (pointer: coarse) {
@slot;
}
}
@theme inline {
/* Extra-small breakpoint (30rem / 480px) for the narrowest phones — the
default scale starts at sm (640px), which leaves a gap between an iPhone SE