Draw the page steps' state layer from the paginator stylesheet

Plan step 36. The paginators put md-state-layer, md-focus-ring and
md-touch-target on their live steps, where the rest of the actions and
communication group (button, FAB, menu item, snackbar, alert) writes no
class list and carries those declarations keyed on its own hooks, as
the plan's data-md-* rule and the brief's "text classes, nothing else"
ask. pagination.css now draws them on a link or button step, the layer
hidden while Livewire disables previous and next; the views render no
class at all, which the render tests pin.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qwx5USif3wFFmxtHg5U1g9
This commit is contained in:
Andreas Reinhold / reini
2026-09-14 17:08:54 +02:00
co-authored by Claude Opus 5
parent f53c559c40
commit 32313e0fd9
4 changed files with 84 additions and 18 deletions
+58 -6
View File
@@ -6,11 +6,12 @@
* The numbered paginator is a row: on its start, what the page holds in body-small on-surface-variant
* — "2130 of 95", or "Page 3 of 10" below `medium` (600px), where the page numbers give way and only
* previous and next stay — and on its end the steps, 4px apart. A step is a 40px circle in label-large
* with tabular figures, M3's icon-button geometry: a live one in on-surface with the state layer, the
* focus ring and a 48px target (`md-state-layer`, `md-focus-ring`, `md-touch-target`,
* foundation/interaction.css); the current page is the selected state, secondary-container, never the
* action colour — it is where you are, not what to do next; an unreachable one (`aria-disabled`) is
* on-surface at 38%. The chevrons mirror in a right-to-left page. The simple paginator is the same
* with tabular figures, M3's icon-button geometry: a live one (a link or a button) in on-surface with
* the state layer, the focus ring and a 48px target — the declarations of the foundation's
* `md-state-layer`, `md-focus-ring` and `md-touch-target` (foundation/interaction.css), keyed on the
* step itself as button.css does, because the views write no class list; the current page is the
* selected state, secondary-container, never the action colour — it is where you are, not what to do
* next; an unreachable one (`aria-disabled`) is on-surface at 38%. The chevrons mirror in a right-to-left page. The simple paginator is the same
* row holding two outlined buttons.
*
* [data-md-pagination] the <nav>
@@ -59,8 +60,59 @@
font-variant-numeric: tabular-nums;
}
button[data-md-pagination-step] {
:is(a, button)[data-md-pagination-step] {
position: relative;
isolation: isolate;
cursor: pointer;
outline: none;
&::before {
content: '';
position: absolute;
inset: 0;
z-index: -1;
border-radius: inherit;
background-color: currentColor;
opacity: 0;
pointer-events: none;
transition: opacity var(--md-sys-motion-effects-fast-duration) var(--md-sys-motion-effects-fast);
}
&::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 100%;
height: 100%;
min-width: var(--md-sys-measurement-space600);
min-height: var(--md-sys-measurement-space600);
transform: translate(-50%, -50%);
}
@media (hover: hover) {
&:hover::before {
opacity: var(--md-sys-state-hover-state-layer-opacity);
}
}
&:focus-visible {
outline: 3px solid var(--md-sys-color-secondary);
outline-offset: 2px;
}
&:focus-visible::before {
opacity: var(--md-sys-state-focus-state-layer-opacity);
}
&:active::before {
opacity: var(--md-sys-state-pressed-state-layer-opacity);
}
/* Livewire disables previous and next while a page loads. */
&:disabled::before {
display: none;
}
}
[data-md-pagination-step][aria-current='page'] {