@gustavogalveza/design-system 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +251 -149
- package/README.md +386 -297
- package/package.json +51 -51
- package/src/behaviors/fab-menu.js +19 -3
- package/src/behaviors/navigation-rail.d.ts +52 -0
- package/src/behaviors/navigation-rail.js +445 -0
- package/src/behaviors/search.js +28 -1
- package/src/behaviors/tooltip.js +8 -3
- package/src/components/app-bar.css +58 -55
- package/src/components/badge.css +31 -18
- package/src/components/bottom-sheet.css +45 -21
- package/src/components/button-group.css +71 -20
- package/src/components/button.css +159 -63
- package/src/components/card.css +235 -31
- package/src/components/carousel.css +285 -60
- package/src/components/checkbox.css +41 -27
- package/src/components/chip.css +260 -70
- package/src/components/date-picker.css +132 -46
- package/src/components/dialog.css +130 -20
- package/src/components/divider.css +38 -10
- package/src/components/extended-fab.css +58 -17
- package/src/components/fab-menu.css +69 -15
- package/src/components/fab.css +73 -9
- package/src/components/field.css +252 -23
- package/src/components/icon-button.css +138 -77
- package/src/components/list.css +74 -20
- package/src/components/loading-indicator.css +134 -104
- package/src/components/menu.css +37 -29
- package/src/components/navigation-bar.css +24 -13
- package/src/components/navigation-drawer.css +38 -32
- package/src/components/navigation-rail.css +507 -11
- package/src/components/progress.css +87 -18
- package/src/components/radio.css +72 -11
- package/src/components/search.css +54 -32
- package/src/components/segmented-button.css +53 -44
- package/src/components/side-sheet.css +78 -36
- package/src/components/slider.css +680 -103
- package/src/components/snackbar.css +105 -27
- package/src/components/split-button.css +191 -132
- package/src/components/surface.css +156 -28
- package/src/components/switch.css +109 -18
- package/src/components/tabs.css +109 -49
- package/src/components/time-picker.css +165 -55
- package/src/components/toolbar.css +27 -6
- package/src/components/tooltip.css +12 -2
|
@@ -1,29 +1,50 @@
|
|
|
1
1
|
/* Icon button — M3 Expressive.
|
|
2
|
-
* Caja visual Small 40, target 48 con ::after,
|
|
2
|
+
* Caja visual Small 40 (32 · 40 · 56 · 96 · 136), target de 48 con ::after,
|
|
3
|
+
* icono 24 (20 · 24 · 24 · 32 · 40).
|
|
3
4
|
* Variantes: standard (base), filled, tonal y outlined.
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* el
|
|
5
|
+
* Forma: Round (full) o Square (12 · 12 · 16 · 28 · 28) con --square;
|
|
6
|
+
* la alternancia invierte la forma desde [aria-pressed="true"].
|
|
7
|
+
* Ancho: Narrow y Wide cambian solo el ancho de la caja visual; el alto, el
|
|
8
|
+
* icono y el target no cambian. Sin JavaScript: el consumidor cambia
|
|
9
|
+
* aria-pressed y, si lo necesita, las clases de tamaño, forma y ancho. */
|
|
7
10
|
|
|
8
11
|
.m3-icon-button {
|
|
9
|
-
/* SmallIconButton (
|
|
12
|
+
/* SmallIconButton. `--m3-icon-button-size` es el alto (search.css lo lee
|
|
13
|
+
* como 40 por defecto); `--m3-icon-button-inline-size` añade el ancho. */
|
|
10
14
|
--m3-icon-button-size: 40px; /* ContainerHeight 40.0.dp */
|
|
15
|
+
--m3-icon-button-inline-size: var(--m3-icon-button-size);
|
|
11
16
|
--m3-icon-button-icon-size: 24px; /* IconSize 24.0.dp */
|
|
12
|
-
|
|
17
|
+
/* Width del kit: cajas no cuadradas, con el icono centrado. */
|
|
18
|
+
--m3-icon-button-narrow: 32px; /* Width=Narrow 32x40 */
|
|
19
|
+
--m3-icon-button-wide: 52px; /* Width=Wide 52x40 */
|
|
13
20
|
/* Borde propio de la variante; el target lo descuenta más abajo. */
|
|
14
21
|
--m3-icon-button-border-width: 0px;
|
|
15
|
-
/*
|
|
22
|
+
/* El outlined pinta 1 en XS/S/M y 2 en L/XL. */
|
|
23
|
+
--m3-icon-button-outline-width: 1px;
|
|
24
|
+
/* CornerFull en una caja no cuadrada: la mitad del alto. Un radio de 999 px
|
|
16
25
|
* se interpola como valor y el spring lo haría pasar por 0 al pulsar. */
|
|
17
26
|
--m3-icon-button-round-radius: calc(var(--m3-icon-button-size) / 2);
|
|
18
|
-
--m3-icon-button-
|
|
19
|
-
--m3-icon-button-pressed-shape:
|
|
20
|
-
--m3-icon-button-
|
|
27
|
+
--m3-icon-button-square-radius: 12px; /* ContainerShapeSquare 12 (S) */
|
|
28
|
+
--m3-icon-button-pressed-shape: 8px; /* PressedContainerShape 8 (S) */
|
|
29
|
+
--m3-icon-button-shape: var(--m3-icon-button-round-radius); /* Round */
|
|
30
|
+
--m3-icon-button-selected-shape: var(--m3-icon-button-square-radius);
|
|
31
|
+
--m3-icon-button-pressed-opacity: 0.08; /* capa Pressed del kit */
|
|
32
|
+
/* El COMPONENT del kit envuelve la caja visual en un target de 48. */
|
|
33
|
+
--m3-icon-button-target-size: 48px;
|
|
34
|
+
--m3-icon-button-target-inset: calc(
|
|
35
|
+
(var(--m3-icon-button-size) -
|
|
36
|
+
max(var(--m3-icon-button-target-size), var(--m3-icon-button-size))) / 2
|
|
37
|
+
);
|
|
38
|
+
--m3-icon-button-target-inset-inline: calc(
|
|
39
|
+
(var(--m3-icon-button-inline-size) -
|
|
40
|
+
max(var(--m3-icon-button-target-size), var(--m3-icon-button-inline-size))) / 2
|
|
41
|
+
);
|
|
21
42
|
|
|
22
43
|
position: relative;
|
|
23
44
|
display: inline-grid;
|
|
24
45
|
place-items: center;
|
|
25
46
|
flex: none;
|
|
26
|
-
inline-size: var(--m3-icon-button-size);
|
|
47
|
+
inline-size: var(--m3-icon-button-inline-size);
|
|
27
48
|
block-size: var(--m3-icon-button-size);
|
|
28
49
|
padding: 0;
|
|
29
50
|
border: 0;
|
|
@@ -44,8 +65,8 @@
|
|
|
44
65
|
color var(--md-sys-motion-effects-fast);
|
|
45
66
|
}
|
|
46
67
|
|
|
47
|
-
/* Capa de estado
|
|
48
|
-
*
|
|
68
|
+
/* Capa de estado del tamaño de la caja visual. El z-index negativo la deja
|
|
69
|
+
* sobre el fondo del botón y bajo el icono, como pide la anatomía M3. */
|
|
49
70
|
.m3-icon-button::before {
|
|
50
71
|
content: "";
|
|
51
72
|
position: absolute;
|
|
@@ -58,14 +79,20 @@
|
|
|
58
79
|
transition: opacity var(--md-sys-motion-effects-fast);
|
|
59
80
|
}
|
|
60
81
|
|
|
61
|
-
/* Target interactivo de 48
|
|
62
|
-
* visual
|
|
82
|
+
/* Target interactivo de 48 (o del ancho de la caja si lo supera): invisible y
|
|
83
|
+
* fuera del flujo, de modo que la caja visual no cambia y no desplaza el
|
|
84
|
+
* layout. */
|
|
63
85
|
.m3-icon-button::after {
|
|
64
86
|
content: "";
|
|
65
87
|
position: absolute;
|
|
66
88
|
/* Los offsets se resuelven contra la caja de padding: si hay borde, el
|
|
67
|
-
target debe crecer lo mismo para seguir midiendo
|
|
68
|
-
inset: calc(
|
|
89
|
+
target debe crecer lo mismo para seguir midiendo lo que pide el kit. */
|
|
90
|
+
inset-block: calc(
|
|
91
|
+
var(--m3-icon-button-target-inset) - var(--m3-icon-button-border-width)
|
|
92
|
+
);
|
|
93
|
+
inset-inline: calc(
|
|
94
|
+
var(--m3-icon-button-target-inset-inline) - var(--m3-icon-button-border-width)
|
|
95
|
+
);
|
|
69
96
|
border-radius: var(--md-sys-shape-corner-full);
|
|
70
97
|
}
|
|
71
98
|
|
|
@@ -82,11 +109,11 @@
|
|
|
82
109
|
}
|
|
83
110
|
|
|
84
111
|
/* Sin override de `border-radius`: el anillo global de base.css pide 4, pero
|
|
85
|
-
* `.m3-icon-button` se declara después y conserva la forma (redonda,
|
|
86
|
-
* si está seleccionado). */
|
|
112
|
+
* `.m3-icon-button` se declara después y conserva la forma (redonda, cuadrada
|
|
113
|
+
* o 12/16/28 si está seleccionado). */
|
|
87
114
|
|
|
88
115
|
.m3-icon-button:active:not(:disabled)::before {
|
|
89
|
-
opacity: var(--
|
|
116
|
+
opacity: var(--m3-icon-button-pressed-opacity); /* 8 % */
|
|
90
117
|
}
|
|
91
118
|
|
|
92
119
|
/* M3 Expressive: al pulsar la forma se vuelve más cuadrada; no se encoge. */
|
|
@@ -116,6 +143,13 @@
|
|
|
116
143
|
|
|
117
144
|
/* --- Variantes ----------------------------------------------------------- */
|
|
118
145
|
|
|
146
|
+
/* Standard: sin contenedor, tinta on-surface-variant. Es el valor base, pero
|
|
147
|
+
* el kit la publica como variante propia; la clase permite explicitarla. */
|
|
148
|
+
.m3-icon-button--standard {
|
|
149
|
+
background: transparent;
|
|
150
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
151
|
+
}
|
|
152
|
+
|
|
119
153
|
.m3-icon-button--filled {
|
|
120
154
|
background: var(--md-sys-color-primary);
|
|
121
155
|
color: var(--md-sys-color-on-primary);
|
|
@@ -127,11 +161,33 @@
|
|
|
127
161
|
}
|
|
128
162
|
|
|
129
163
|
.m3-icon-button--outlined {
|
|
130
|
-
--m3-icon-button-border-width:
|
|
164
|
+
--m3-icon-button-border-width: var(--m3-icon-button-outline-width);
|
|
131
165
|
border: var(--m3-icon-button-border-width) solid var(--md-sys-color-outline);
|
|
132
166
|
color: var(--md-sys-color-on-surface-variant);
|
|
133
167
|
}
|
|
134
168
|
|
|
169
|
+
/* --- Forma cuadrada ------------------------------------------------------ */
|
|
170
|
+
|
|
171
|
+
/* Type=Square en el kit: radio 12/16/28 en reposo. Al seleccionar invierte la
|
|
172
|
+
* forma, igual que Round pasa a Square. */
|
|
173
|
+
.m3-icon-button--square {
|
|
174
|
+
--m3-icon-button-shape: var(--m3-icon-button-square-radius);
|
|
175
|
+
--m3-icon-button-selected-shape: var(--m3-icon-button-round-radius);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/* --- Ancho --------------------------------------------------------------- */
|
|
179
|
+
|
|
180
|
+
/* Width del kit: solo cambia el ancho; alto, icono, forma y target siguen
|
|
181
|
+
* dependiendo de la talla. La caja estrecha o ancha es un estadio, no un
|
|
182
|
+
* cuadrado con padding. */
|
|
183
|
+
.m3-icon-button--narrow {
|
|
184
|
+
--m3-icon-button-inline-size: var(--m3-icon-button-narrow);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.m3-icon-button--wide {
|
|
188
|
+
--m3-icon-button-inline-size: var(--m3-icon-button-wide);
|
|
189
|
+
}
|
|
190
|
+
|
|
135
191
|
/* --- Alternancia (toggle) ------------------------------------------------ */
|
|
136
192
|
|
|
137
193
|
/* El CSS no cambia aria-pressed: solo dibuja el estado. La selección no
|
|
@@ -159,7 +215,9 @@
|
|
|
159
215
|
|
|
160
216
|
.m3-icon-button--outlined[aria-pressed="true"] {
|
|
161
217
|
background: var(--md-sys-color-inverse-surface);
|
|
162
|
-
|
|
218
|
+
/* El kit quita el trazo al seleccionar: sin borde, no un borde
|
|
219
|
+
* transparente, para que el estado y el target midan lo mismo. */
|
|
220
|
+
--m3-icon-button-border-width: 0px;
|
|
163
221
|
color: var(--md-sys-color-inverse-on-surface);
|
|
164
222
|
}
|
|
165
223
|
|
|
@@ -174,9 +232,10 @@
|
|
|
174
232
|
/* Outlined cuando no está seleccionado, filled cuando sí. Si el icono es un
|
|
175
233
|
* SVG, el consumidor debe aportar su variante rellena.
|
|
176
234
|
* La lista no incluye `opsz`: lo resuelve `font-optical-sizing: auto` de
|
|
177
|
-
* icons.css con el `font-size` real del glifo (20 en XS, 24 en S y M
|
|
178
|
-
* clavarlo en 24, el icono de 20 del XS se dibujaba con el
|
|
179
|
-
* y perdía la ventaja del eje variable que icons.css deja
|
|
235
|
+
* icons.css con el `font-size` real del glifo (20 en XS, 24 en S y M, 32 en L
|
|
236
|
+
* y 40 en XL). Al clavarlo en 24, el icono de 20 del XS se dibujaba con el
|
|
237
|
+
* trazo óptico de 24 y perdía la ventaja del eje variable que icons.css deja
|
|
238
|
+
* en `auto`. */
|
|
180
239
|
.m3-icon-button[aria-pressed] .m3-icon {
|
|
181
240
|
font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0;
|
|
182
241
|
}
|
|
@@ -187,85 +246,79 @@
|
|
|
187
246
|
|
|
188
247
|
/* --- Deshabilitado ------------------------------------------------------- */
|
|
189
248
|
|
|
190
|
-
/* Contenedor
|
|
191
|
-
*
|
|
192
|
-
*
|
|
249
|
+
/* Contenedor on-surface 10 % (DisabledContainerOpacity) en cualquier variante
|
|
250
|
+
* con relleno, incluido el toggle; contenido on-surface 38 % (DisabledOpacity).
|
|
251
|
+
* El estado seleccionado conserva su forma (SelectedDisabledContainerOpacity
|
|
252
|
+
* también es 10 %). */
|
|
193
253
|
.m3-icon-button:disabled {
|
|
194
254
|
cursor: not-allowed;
|
|
195
|
-
color: color-mix(in oklab, var(--md-sys-color-on-surface
|
|
255
|
+
color: color-mix(in oklab, var(--md-sys-color-on-surface) 38%, transparent);
|
|
196
256
|
}
|
|
197
257
|
|
|
198
258
|
.m3-icon-button:disabled::before {
|
|
199
259
|
opacity: 0;
|
|
200
260
|
}
|
|
201
261
|
|
|
202
|
-
.m3-icon-button--filled:disabled
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
.m3-icon-button--filled[aria-pressed="false"]:disabled {
|
|
209
|
-
background: color-mix(
|
|
210
|
-
in oklab,
|
|
211
|
-
var(--md-sys-color-surface-container) 10%,
|
|
212
|
-
transparent
|
|
213
|
-
);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
.m3-icon-button--tonal:disabled {
|
|
217
|
-
background: color-mix(
|
|
218
|
-
in oklab,
|
|
219
|
-
var(--md-sys-color-secondary-container) 10%,
|
|
220
|
-
transparent
|
|
221
|
-
);
|
|
222
|
-
color: color-mix(in oklab, var(--md-sys-color-on-surface) 38%, transparent);
|
|
262
|
+
.m3-icon-button--filled:disabled,
|
|
263
|
+
.m3-icon-button--tonal:disabled,
|
|
264
|
+
.m3-icon-button--outlined[aria-pressed="true"]:disabled {
|
|
265
|
+
background: color-mix(in oklab, var(--md-sys-color-on-surface) 10%, transparent);
|
|
223
266
|
}
|
|
224
267
|
|
|
268
|
+
/* El outlined sin seleccionar conserva el borde a contraste pleno; el
|
|
269
|
+
* seleccionado lo pierde al cambiar a inverse-surface. */
|
|
225
270
|
.m3-icon-button--outlined:disabled {
|
|
226
271
|
background: transparent;
|
|
227
|
-
border-color: color-
|
|
228
|
-
in oklab,
|
|
229
|
-
var(--md-sys-color-outline) 12%,
|
|
230
|
-
transparent
|
|
231
|
-
);
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
.m3-icon-button--tonal[aria-pressed="true"]:disabled {
|
|
235
|
-
background: color-mix(
|
|
236
|
-
in oklab,
|
|
237
|
-
var(--md-sys-color-secondary) 10%,
|
|
238
|
-
transparent
|
|
239
|
-
);
|
|
272
|
+
border-color: var(--md-sys-color-outline);
|
|
240
273
|
}
|
|
241
274
|
|
|
242
275
|
.m3-icon-button--outlined[aria-pressed="true"]:disabled {
|
|
243
|
-
|
|
244
|
-
in oklab,
|
|
245
|
-
var(--md-sys-color-inverse-surface) 10%,
|
|
246
|
-
transparent
|
|
247
|
-
);
|
|
276
|
+
--m3-icon-button-border-width: 0px;
|
|
248
277
|
border-color: transparent;
|
|
249
|
-
color: color-mix(in oklab, var(--md-sys-color-on-surface) 38%, transparent);
|
|
250
278
|
}
|
|
251
279
|
|
|
252
280
|
/* --- Tamaños ------------------------------------------------------------- */
|
|
253
281
|
|
|
254
|
-
/* Small (40 / 24) es el valor por defecto.
|
|
255
|
-
*
|
|
282
|
+
/* Small (40 / 24 / 32-52) es el valor por defecto. El kit publica cinco
|
|
283
|
+
* tallas; sus anchos Narrow/Default/Wide se guardan como variables para que
|
|
284
|
+
* --narrow y --wide funcionen con cualquier talla. */
|
|
256
285
|
|
|
257
286
|
.m3-icon-button--xs {
|
|
258
287
|
--m3-icon-button-size: 32px; /* XSmallIconButton ContainerHeight 32.0.dp */
|
|
259
288
|
--m3-icon-button-icon-size: 20px; /* XSmallIconButton IconSize 20.0.dp */
|
|
260
|
-
--m3-icon-button-
|
|
289
|
+
--m3-icon-button-narrow: 28px; /* Narrow 28x32 */
|
|
290
|
+
--m3-icon-button-wide: 40px; /* Wide 40x32 */
|
|
291
|
+
--m3-icon-button-square-radius: 12px;
|
|
292
|
+
--m3-icon-button-pressed-shape: 8px;
|
|
261
293
|
}
|
|
262
294
|
|
|
263
295
|
.m3-icon-button--md {
|
|
264
296
|
--m3-icon-button-size: 56px; /* MediumIconButton ContainerHeight 56.0.dp */
|
|
265
297
|
--m3-icon-button-icon-size: 24px; /* MediumIconButton IconSize 24.0.dp */
|
|
266
|
-
--m3-icon-button-
|
|
267
|
-
--m3-icon-button-
|
|
268
|
-
--m3-icon-button-
|
|
298
|
+
--m3-icon-button-narrow: 48px; /* Narrow 48x56 */
|
|
299
|
+
--m3-icon-button-wide: 72px; /* Wide 72x56 */
|
|
300
|
+
--m3-icon-button-square-radius: 16px;
|
|
301
|
+
--m3-icon-button-pressed-shape: 12px;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.m3-icon-button--lg {
|
|
305
|
+
--m3-icon-button-size: 96px; /* LargeIconButton ContainerHeight 96.0.dp */
|
|
306
|
+
--m3-icon-button-icon-size: 32px; /* LargeIconButton IconSize 32.0.dp */
|
|
307
|
+
--m3-icon-button-narrow: 64px; /* Narrow 64x96 */
|
|
308
|
+
--m3-icon-button-wide: 128px; /* Wide 128x96 */
|
|
309
|
+
--m3-icon-button-square-radius: 28px;
|
|
310
|
+
--m3-icon-button-pressed-shape: 16px;
|
|
311
|
+
--m3-icon-button-outline-width: 2px;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.m3-icon-button--xl {
|
|
315
|
+
--m3-icon-button-size: 136px; /* XLargeIconButton ContainerHeight 136.0.dp */
|
|
316
|
+
--m3-icon-button-icon-size: 40px; /* XLargeIconButton IconSize 40.0.dp */
|
|
317
|
+
--m3-icon-button-narrow: 104px; /* Narrow 104x136 */
|
|
318
|
+
--m3-icon-button-wide: 184px; /* Wide 184x136 */
|
|
319
|
+
--m3-icon-button-square-radius: 28px;
|
|
320
|
+
--m3-icon-button-pressed-shape: 16px;
|
|
321
|
+
--m3-icon-button-outline-width: 2px;
|
|
269
322
|
}
|
|
270
323
|
|
|
271
324
|
/* --- RTL ----------------------------------------------------------------- */
|
|
@@ -278,8 +331,8 @@
|
|
|
278
331
|
|
|
279
332
|
/* --- Alto contraste ------------------------------------------------------ */
|
|
280
333
|
|
|
281
|
-
/* En colores forzados las variantes colapsan: un borde conserva la forma y,
|
|
282
|
-
*
|
|
334
|
+
/* En colores forzados las variantes colapsan: un borde conserva la forma y, en
|
|
335
|
+
* el seleccionado, el color Highlight y el icono relleno mantienen la
|
|
283
336
|
* distinción. */
|
|
284
337
|
@media (forced-colors: active) {
|
|
285
338
|
.m3-icon-button {
|
|
@@ -289,6 +342,14 @@
|
|
|
289
342
|
border: 1px solid ButtonText;
|
|
290
343
|
}
|
|
291
344
|
|
|
345
|
+
/* Los dos estados que ponen la variable a 0 fuera de este modo (outlined
|
|
346
|
+
* seleccionado y su deshabilitado) sí pintan el borde de 1 aquí; si no, el
|
|
347
|
+
* `::after` resuelve los insets con 0 y el target mide 46 en vez de 48. */
|
|
348
|
+
.m3-icon-button[aria-pressed="true"],
|
|
349
|
+
.m3-icon-button[aria-pressed="true"]:disabled {
|
|
350
|
+
--m3-icon-button-border-width: 1px;
|
|
351
|
+
}
|
|
352
|
+
|
|
292
353
|
.m3-icon-button[aria-pressed="true"] {
|
|
293
354
|
border-color: Highlight;
|
|
294
355
|
}
|
package/src/components/list.css
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
/* ==========================================================================
|
|
2
2
|
List — Material 3 Expressive
|
|
3
3
|
Lista vertical sobre <ul>/<li> nativos. El ítem interactivo es un <a> o un
|
|
4
|
-
<button>; nunca se anidan acciones dentro de él.
|
|
4
|
+
<button>; nunca se anidan acciones dentro de él. La fila con un control al
|
|
5
|
+
final (checkbox, radio, switch) es estática: el control es el único target y
|
|
6
|
+
toma su nombre de la etiqueta de la fila.
|
|
5
7
|
Alturas: 56 (una línea), 72 (dos) y 88 (tres). Las tres son mínimos: el
|
|
6
|
-
contenido puede crecer con el zoom de texto.
|
|
8
|
+
contenido puede crecer con el zoom de texto. 16 de sangría y 16 de hueco
|
|
9
|
+
entre slots; el colchón vertical es 4 y 12 a tres líneas (el kit dibuja 8
|
|
10
|
+
en una caja de contenido fija de 40: su frame cuenta el overline oculto, así
|
|
11
|
+
que el número no es trasplantable). El colchón de 4 sale de `--space-1`
|
|
12
|
+
(0,25rem): con la raíz al 200 % mide 8 y la fila de una línea pasa a 64,
|
|
13
|
+
que sigue por encima del target de 48; el de 12 es px fijo.
|
|
7
14
|
Forma expresiva: 4 en reposo, 12 al pasar el cursor, 16 en foco, pulsado y
|
|
8
15
|
seleccionado. Solo cambia el radio: la caja no se mueve ni el texto se
|
|
9
16
|
recompone (0 px de layout). El morph va por `motion-spatial-fast`; color y
|
|
@@ -34,6 +41,29 @@
|
|
|
34
41
|
/* El contenedor no pinta fondo: la lista se apoya en la superficie donde vive
|
|
35
42
|
* (surface en página, surface-container-* dentro de una tarjeta). */
|
|
36
43
|
|
|
44
|
+
/* --- Subcabecera de sección ---------------------------------------------- */
|
|
45
|
+
|
|
46
|
+
/* El kit de Lists no publica subcabecera. La medida sale de la tabla de M3
|
|
47
|
+
* (tile de 48 dp, 16 de sangría, label large) y del `Divider with subhead` del
|
|
48
|
+
* kit, cuya etiqueta es 14/20 · 500. Va fuera del <ul>, como encabezado del
|
|
49
|
+
* bloque: dentro rompería la semántica de lista (`<li>` sin ítem) o exigiría
|
|
50
|
+
* un rol extra. */
|
|
51
|
+
.m3-list__subheader {
|
|
52
|
+
display: flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
min-block-size: 48px;
|
|
55
|
+
margin: 0;
|
|
56
|
+
/* 12 + 24 (label large) + 12 = 48; con el texto al 200 % crece a 64. */
|
|
57
|
+
padding-block: 12px;
|
|
58
|
+
padding-inline: var(--m3-list-leading-space, 16px);
|
|
59
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
60
|
+
font-family: var(--md-ref-typeface-plain);
|
|
61
|
+
font-size: var(--md-sys-typescale-label-large-size);
|
|
62
|
+
line-height: var(--md-sys-typescale-label-large-line);
|
|
63
|
+
letter-spacing: var(--md-sys-typescale-label-large-tracking);
|
|
64
|
+
font-weight: var(--md-sys-typescale-label-large-weight);
|
|
65
|
+
}
|
|
66
|
+
|
|
37
67
|
/* --- Ítem y alturas ------------------------------------------------------ */
|
|
38
68
|
|
|
39
69
|
.m3-list__item {
|
|
@@ -61,10 +91,12 @@
|
|
|
61
91
|
box-sizing: border-box;
|
|
62
92
|
min-block-size: var(--m3-list-item-height);
|
|
63
93
|
margin: 0;
|
|
64
|
-
/* 4 de colchón vertical:
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
94
|
+
/* 4 de colchón vertical: la altura es un mínimo y el contenido de una línea
|
|
95
|
+
* mide 24, así que cualquier valor hasta 16 da exactamente 56. El kit dibuja
|
|
96
|
+
* 8 dentro de una caja de contenido fija de 40 (su frame cuenta el overline
|
|
97
|
+
* oculto); trasplantar ese 8 no reproduce nada y movía a los consumidores que
|
|
98
|
+
* no etiquetan la fila. Con 4, además, un control de 48 cabe justo: 48 + 4 +
|
|
99
|
+
* 4 = 56. */
|
|
68
100
|
padding-block: var(--space-1);
|
|
69
101
|
padding-inline: var(--m3-list-leading-space) var(--m3-list-leading-space);
|
|
70
102
|
border: 0;
|
|
@@ -90,11 +122,12 @@
|
|
|
90
122
|
padding-inline-end: var(--m3-list-trailing-padding);
|
|
91
123
|
}
|
|
92
124
|
|
|
93
|
-
/* La imagen líder mide exactamente la altura de la fila de una línea: el
|
|
94
|
-
* colchón vertical la
|
|
95
|
-
* × `ItemOneLineContainerHeight 56`. Solo aplica a
|
|
96
|
-
*
|
|
97
|
-
* pisaría por
|
|
125
|
+
/* La imagen líder mide exactamente la altura de la fila de una línea: con el
|
|
126
|
+
* colchón vertical la fila crecería a 64 (56 + 4 + 4) y rompería
|
|
127
|
+
* `ItemLeadingImageHeight 56` × `ItemOneLineContainerHeight 56`. Solo aplica a
|
|
128
|
+
* una línea: en dos, 56 + 8 = 64 cabe en 72; en tres manda el
|
|
129
|
+
* `padding-block: 12px` de su regla (0,2,0), que esta pisaría por
|
|
130
|
+
* especificidad. */
|
|
98
131
|
.m3-list__item:not(.m3-list__item--three-line, .m3-list__item--two-line)
|
|
99
132
|
> .m3-list__row:has(> .m3-list__leading .m3-list__media) {
|
|
100
133
|
padding-block: 0;
|
|
@@ -140,11 +173,31 @@
|
|
|
140
173
|
overflow: hidden;
|
|
141
174
|
text-overflow: ellipsis;
|
|
142
175
|
white-space: nowrap;
|
|
176
|
+
/* `text-align: end` sigue al borde final en LTR y RTL (el kit alinea a la
|
|
177
|
+
* derecha). */
|
|
178
|
+
text-align: end;
|
|
143
179
|
color: var(--md-sys-color-on-surface-variant);
|
|
144
180
|
font-family: var(--md-ref-typeface-plain);
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
181
|
+
/* Label large 14/20 · 500 · +0,1: el `Trailing element` del list item
|
|
182
|
+
* expresivo del kit (y el texto visible de sus instancias en Search). El
|
|
183
|
+
* list item baseline publica 11/16 para «Trailing supporting text»; el set
|
|
184
|
+
* expresivo, que es el que fija forma y estados aquí, usa 14/20. Solo
|
|
185
|
+
* cambian peso y tracking respecto al body-medium anterior. */
|
|
186
|
+
font-size: var(--md-sys-typescale-label-large-size);
|
|
187
|
+
line-height: var(--md-sys-typescale-label-large-line);
|
|
188
|
+
letter-spacing: var(--md-sys-typescale-label-large-tracking);
|
|
189
|
+
font-weight: var(--md-sys-typescale-label-large-weight);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/* Con un control dentro, el slot deja de recortar: el anillo de foco del
|
|
193
|
+
* control se dibuja 5 px fuera de su caja y `overflow: hidden` lo cortaría.
|
|
194
|
+
* Tampoco hay texto que truncar. */
|
|
195
|
+
.m3-list__trailing:has(> :is(.m3-checkbox, .m3-radio, .m3-switch)) {
|
|
196
|
+
display: flex;
|
|
197
|
+
align-items: center;
|
|
198
|
+
max-inline-size: none;
|
|
199
|
+
overflow: visible;
|
|
200
|
+
white-space: normal;
|
|
148
201
|
}
|
|
149
202
|
|
|
150
203
|
/* El icono se centra siempre; el hueco solo existe cuando comparte el slot con
|
|
@@ -287,9 +340,10 @@ button.m3-list__row {
|
|
|
287
340
|
|
|
288
341
|
/* `aria-current` es el estado; `--selected` es el mismo dibujo para quien no
|
|
289
342
|
* use navegación. La segunda señal es el peso de la etiqueta (emphasized) más
|
|
290
|
-
* el check que aporta el markup.
|
|
343
|
+
* el check que aporta el markup. `aria-current="false"` es un valor válido de
|
|
344
|
+
* ARIA que significa «no es el actual»: no debe pintarse como seleccionado. */
|
|
291
345
|
.m3-list__item--selected,
|
|
292
|
-
.m3-list__row[aria-current] {
|
|
346
|
+
.m3-list__row[aria-current]:not([aria-current="false"]) {
|
|
293
347
|
--m3-list-shape: var(--md-sys-shape-corner-large);
|
|
294
348
|
--m3-list-shape-hover: var(--md-sys-shape-corner-large);
|
|
295
349
|
}
|
|
@@ -298,13 +352,13 @@ button.m3-list__row {
|
|
|
298
352
|
* navigation-drawer y navigation-rail para el destino activo, así que una fila
|
|
299
353
|
* seleccionada significa lo mismo en toda la biblioteca. La capa de estado
|
|
300
354
|
* hereda `on-secondary-container` por `currentColor`. */
|
|
301
|
-
.m3-list__row[aria-current],
|
|
355
|
+
.m3-list__row[aria-current]:not([aria-current="false"]),
|
|
302
356
|
.m3-list__item--selected .m3-list__row {
|
|
303
357
|
background: var(--md-sys-color-secondary-container);
|
|
304
358
|
color: var(--md-sys-color-on-secondary-container);
|
|
305
359
|
}
|
|
306
360
|
|
|
307
|
-
.m3-list__row[aria-current]
|
|
361
|
+
.m3-list__row[aria-current]:not([aria-current="false"])
|
|
308
362
|
:is(.m3-list__overline, .m3-list__supporting, .m3-list__trailing, .m3-list__leading),
|
|
309
363
|
.m3-list__item--selected
|
|
310
364
|
.m3-list__row
|
|
@@ -312,7 +366,7 @@ button.m3-list__row {
|
|
|
312
366
|
color: inherit;
|
|
313
367
|
}
|
|
314
368
|
|
|
315
|
-
.m3-list__row[aria-current] .m3-list__label,
|
|
369
|
+
.m3-list__row[aria-current]:not([aria-current="false"]) .m3-list__label,
|
|
316
370
|
.m3-list__item--selected .m3-list__row .m3-list__label {
|
|
317
371
|
font-weight: var(--md-sys-typescale-emphasized-body-large-weight);
|
|
318
372
|
}
|
|
@@ -374,7 +428,7 @@ button.m3-list__row {
|
|
|
374
428
|
}
|
|
375
429
|
|
|
376
430
|
/* La selección conserva un borde de sistema (además del peso de etiqueta). */
|
|
377
|
-
.m3-list__row[aria-current],
|
|
431
|
+
.m3-list__row[aria-current]:not([aria-current="false"]),
|
|
378
432
|
.m3-list__item--selected .m3-list__row {
|
|
379
433
|
outline: 2px solid Highlight;
|
|
380
434
|
outline-offset: -2px;
|