Ask about the thumb, not the window width
There is a careful touch-target pass in this stylesheet -- 44px fields, 44px delete buttons, a padded hit area for the rulings link. Every rule in it sits behind `max-width: 700px`. A phone held sideways is 844px wide. So none of that work applied to the device it was written for, half the time. Measured on an emulated touch device with the sidebar open -- twelve controls under 44px at 844x390 and again at 915x412: the rulings link 91x14 the dedicated-dealer box 13x13 chip-colour delete 28px wide blinds-direction select 32px tall five panel headers 38px The rules are restated against `pointer: coarse`. The width-scoped block keeps its layout changes -- one column, stacked dialogs -- because those really are about how much room there is. This is only about what a thumb can hit, so it asks about the thumb. 844x390 touch 12 controls under 44px -> 1 915x412 touch 12 -> 1 390x844 touch 6 -> 1 360x640 touch 6 -> 1 The one left is the bare 24x24 checkbox, whose row is 44px tall -- the row is the target, which is the existing design and the only thing that works for a checkbox. Two things were too small on every device, not just touch, and are fixed outright. The panel headers -- the sidebar's entire navigation -- were 38px everywhere, phones included; the pass below never reached them. And the rulings link was 91x14, which misses the 24px minimum with a mouse as well as with a thumb. Under 24px anywhere is now zero, at every size measured. Two traps worth recording. A <summary> only draws its disclosure triangle while it is display: list-item, so the headers get there on padding rather than a flex box. And a <summary> is content-box, so `min-height: 44px` was *added* to the padding and gave 71px -- the same box-model trap as the header buttons one PR ago, in a different tag. Both are stated in the CSS where the next person will hit them. 214 tests still passing; layout audit and contrast clean at six sizes across touch and pointer contexts; no console errors; panels still toggle and the triangle is still there. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_015bnp7xKUPFFSpwkYNFaPgb
This commit is contained in:
@@ -1013,9 +1013,24 @@ button,
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* A bare checkbox ships at 13x13, which misses the 24px minimum with a mouse as well
|
||||
as with a thumb. The row around it is the real target on touch, but the box itself
|
||||
should be findable on any device. */
|
||||
#dedicatedDealerToggle {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
.linkBtn {
|
||||
background: none;
|
||||
border: none;
|
||||
/* An underlined word was a 91x14 target, which misses the 24px minimum with a
|
||||
mouse as well as with a thumb. The coarse-pointer block takes it to 44; this is
|
||||
the floor everywhere else, and it changes nothing about how it looks. */
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
min-height: 24px;
|
||||
padding: 0;
|
||||
color: #d8b46a;
|
||||
font-family: inherit;
|
||||
@@ -1470,7 +1485,16 @@ button,
|
||||
|
||||
.sidebarPanel summary {
|
||||
cursor: pointer;
|
||||
padding: 0.7rem 0;
|
||||
/* These headers are the sidebar's whole navigation and were 38px tall on every
|
||||
device, phones included — the touch pass further down never reached them.
|
||||
Padding rather than a flex box with min-height, because a <summary> only draws
|
||||
its disclosure triangle while it is display: list-item. */
|
||||
padding: 0.85rem 0;
|
||||
/* A <summary> is content-box, so min-height would have been *added* to the padding
|
||||
— measured at 71px before this line went in. Same trap the header buttons were
|
||||
in, one file over. */
|
||||
box-sizing: border-box;
|
||||
min-height: 44px;
|
||||
font-size: 0.9rem;
|
||||
color: #eee;
|
||||
letter-spacing: 0.03em;
|
||||
@@ -3185,3 +3209,66 @@ textarea:focus-visible {
|
||||
font-size: 0.72rem;
|
||||
color: #9a9a9a;
|
||||
}
|
||||
|
||||
/* ---------- Touch targets on a wide touch screen ----------
|
||||
|
||||
Every touch-target rule in this file sits behind `max-width: 700px`, and width was
|
||||
never the question. A phone held sideways is 844px wide, so none of that work
|
||||
applied to it. Measured on an emulated touch device at 844x390, with the sidebar
|
||||
panels open: twelve controls under 44px, including the rulings link at 91x14 and
|
||||
the dedicated-dealer checkbox at 13x13.
|
||||
|
||||
Restated here against the pointer instead of the viewport. The width-scoped block
|
||||
keeps its layout changes — one column, stacked dialogs — because those really are
|
||||
about how much room there is. This is only about what a thumb can hit, so it asks
|
||||
about the thumb. */
|
||||
@media (pointer: coarse) {
|
||||
.panelBody input:not([type="checkbox"]):not([type="color"]),
|
||||
.subPanelBody input:not([type="checkbox"]):not([type="color"]),
|
||||
.panelBody select {
|
||||
font-size: 16px;
|
||||
min-height: 44px;
|
||||
padding: 0.4rem 0.6rem;
|
||||
}
|
||||
|
||||
.panelBody .holdemBtnSmall,
|
||||
.handHistoryActions .holdemBtn,
|
||||
.toastAction {
|
||||
min-height: 44px;
|
||||
}
|
||||
|
||||
/* Destructive and tiny is the worst combination: these delete a chip colour or a
|
||||
custom field, and are 28px wide. */
|
||||
.removeChipColorBtn,
|
||||
.removeFieldBtn {
|
||||
min-width: 44px;
|
||||
min-height: 44px;
|
||||
}
|
||||
|
||||
/* flex-shrink would take a stated width straight back off again. */
|
||||
.chipColorInput {
|
||||
flex: none;
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
}
|
||||
|
||||
/* A bare checkbox can't grow into a target, but the row it sits in can — the
|
||||
label is what a tap actually lands on. */
|
||||
.panelBody .fieldRow {
|
||||
min-height: 44px;
|
||||
}
|
||||
|
||||
#dedicatedDealerToggle {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
/* An underlined word is a 14px-tall target; give it room without making it look
|
||||
like a button. */
|
||||
.linkBtn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
min-height: 44px;
|
||||
padding: 0 0.4rem;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user