Hold the time picker's two selectors apart
The 24-hour clock has no period selector beside the hour and minute boxes, so M3 widens them to 114px; AM/PM takes its own tertiary-container rather than borrowing the boxes' primary-container; a disabled period button uses M3's 12% disabled container, not 10%; and the pair is a radio group, which is what M3's labelling table asks for, so the arrows move between AM and PM. Plan step 20, findings IN-10, IN-11, IN-26 and IN-27. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qwx5USif3wFFmxtHg5U1g9
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
f30fd575cf
commit
9624d4bfd4
@@ -11,7 +11,9 @@
|
||||
* [data-timepicker-display] the time selector: hour and minute boxes 96×80 (display-large,
|
||||
* small corner; primary-container when selected, otherwise
|
||||
* surface-container-highest), a 24px separator, and the period
|
||||
* selector 52×80 beside them, 4px away
|
||||
* selector 52×80 beside them, 4px away. On a 24-hour clock
|
||||
* (data-cycle="24") there is no period selector and the boxes are
|
||||
* 114px, TimeSelector24HVerticalContainerWidth.
|
||||
* [data-timepicker-dial] 256px, surface-container-highest; numbers in body-large at radius
|
||||
* 101 (the 24-hour inner ring at 69), a primary selector — a 2px line,
|
||||
* an 8px centre and a 48px handle — with the number under the handle
|
||||
@@ -20,9 +22,11 @@
|
||||
* "Minute" (or the error) below in body-small, the period 52×72
|
||||
* [data-timepicker-actions] a 48px row: the mode toggle, then Cancel and OK
|
||||
*
|
||||
* The period selector is Compose's current one (ComposeMaterial3Flags.isUpdatedTimepickerToggleEnabled,
|
||||
* on by default): two toggle buttons 4px apart, round and surface-container-lowest when off, a 12px
|
||||
* corner and primary-container with a bold label when on, not the outlined pair of the tokens.
|
||||
* The period selector keeps Compose's current shape (ComposeMaterial3Flags.isUpdatedTimepickerToggleEnabled,
|
||||
* on by default): two buttons 4px apart, round and surface-container-lowest when off, a 12px corner
|
||||
* when on, not the outlined pair of the tokens. The selected colour is M3's own tertiary-container
|
||||
* with a bold label (PeriodSelectorSelectedContainerColor), which keeps AM/PM apart from the
|
||||
* primary-container hour and minute boxes. They are radios, so the state is `aria-checked`.
|
||||
*
|
||||
* In a landscape window with no room for the upright dial the dial variant lies on its side, as
|
||||
* Compose's HorizontalTimePicker does: the display with the period selector (216×38, 16px under it)
|
||||
@@ -130,6 +134,13 @@
|
||||
color: var(--md-sys-color-on-primary-container);
|
||||
}
|
||||
|
||||
/* A 24-hour clock has no period selector beside the boxes, and M3 widens them into the room
|
||||
(TimePickerTokens.TimeSelector24HVerticalContainerWidth = 114dp). Landscape keeps 96px: the
|
||||
display is a 216px column there. */
|
||||
[data-timepicker-display][data-cycle="24"] [data-timepicker-box] {
|
||||
width: 7.125rem;
|
||||
}
|
||||
|
||||
[data-timepicker-separator] {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
@@ -165,20 +176,22 @@
|
||||
}
|
||||
|
||||
[data-timepicker-period] > button:active,
|
||||
[data-timepicker-period] > button[aria-pressed="true"] {
|
||||
[data-timepicker-period] > button[aria-checked="true"] {
|
||||
border-radius: 0.75rem;
|
||||
}
|
||||
|
||||
[data-timepicker-period] > button[aria-pressed="true"] {
|
||||
background-color: var(--md-sys-color-primary-container);
|
||||
color: var(--md-sys-color-on-primary-container);
|
||||
/* Tertiary, not the primary the hour and minute boxes take: M3 gives the two selectors different
|
||||
emphases (PeriodSelectorSelectedContainerColor = TertiaryContainer). */
|
||||
[data-timepicker-period] > button[aria-checked="true"] {
|
||||
background-color: var(--md-sys-color-tertiary-container);
|
||||
color: var(--md-sys-color-on-tertiary-container);
|
||||
font-weight: var(--md-ref-typeface-weight-bold);
|
||||
}
|
||||
|
||||
[data-timepicker-period] > button:disabled {
|
||||
cursor: default;
|
||||
color: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);
|
||||
background-color: color-mix(in srgb, var(--md-sys-color-on-surface) 10%, transparent);
|
||||
background-color: color-mix(in srgb, var(--md-sys-color-on-surface) 12%, transparent);
|
||||
}
|
||||
|
||||
/* ---- The dial ----------------------------------------------------------------------------- */
|
||||
@@ -436,6 +449,10 @@
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
[data-timepicker-surface][data-mode="dial"] [data-timepicker-display][data-cycle="24"] [data-timepicker-box] {
|
||||
width: 6rem;
|
||||
}
|
||||
|
||||
[data-timepicker-surface][data-mode="dial"] [data-timepicker-display] [data-timepicker-period] {
|
||||
flex-direction: row;
|
||||
width: 13.5rem;
|
||||
|
||||
Reference in New Issue
Block a user