@slotted/styles 0.1.0-beta.39 → 0.1.0-beta.40
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/package.json +5 -1
- package/src/aspect-ratio/aspect-ratio.css +15 -14
- package/src/badge/badge.css +3 -0
- package/src/calendar/calendar.css +210 -171
- package/src/calendar/calendar.tokens.json +17 -2
- package/src/clock/clock.css +246 -0
- package/src/clock/clock.tokens.json +44 -0
- package/src/date-picker/date-picker.css +5 -302
- package/src/date-picker/date-picker.tokens.json +1 -26
- package/src/date-range-picker/date-range-picker.css +4 -490
- package/src/date-range-picker/date-range-picker.tokens.json +1 -41
- package/src/datetime-picker/datetime-picker.css +23 -738
- package/src/datetime-picker/datetime-picker.tokens.json +1 -53
- package/src/datetime-range-picker/datetime-range-picker.css +6 -959
- package/src/datetime-range-picker/datetime-range-picker.tokens.json +1 -71
- package/src/grid/grid.css +3 -2
- package/src/inline/inline.css +1 -1
- package/src/picker-panel/picker-panel.css +1074 -0
- package/src/picker-panel/picker-panel.tokens.json +77 -0
- package/src/progress-indicator/progress-indicator.css +3 -2
- package/src/skeleton/skeleton.css +19 -0
- package/src/stack/stack.css +1 -1
- package/src/time-picker/time-picker.css +4 -545
- package/src/time-picker/time-picker.tokens.json +1 -41
- package/src/time-range-picker/time-range-picker.css +5 -875
- package/src/time-range-picker/time-range-picker.tokens.json +1 -70
- package/src/tree/tree.css +5 -1
|
@@ -25,20 +25,33 @@
|
|
|
25
25
|
container-name: slotted-calendar;
|
|
26
26
|
|
|
27
27
|
--_font-size: var(--slotted-control-font-size-md, 13px);
|
|
28
|
-
--_gap:
|
|
28
|
+
--_gap: 0px;
|
|
29
29
|
--_icon-size: var(--slotted-control-icon-size-md, 16px);
|
|
30
30
|
/**
|
|
31
|
-
* A cell is
|
|
32
|
-
* of
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* the coarse-pointer block the theme emits takes it to 44 on touch.
|
|
31
|
+
* A cell is two pixels wider than the control and two pixels lower: seven
|
|
32
|
+
* of them are whole pixels, and six weeks stand beside a clock without
|
|
33
|
+
* scrolling. `dense` keeps both above the WCAG minimum, and the
|
|
34
|
+
* coarse-pointer block the theme emits takes them to 46 and 42 on touch.
|
|
36
35
|
*/
|
|
37
|
-
--_cell-size: var(
|
|
38
|
-
|
|
36
|
+
--_cell-size: var(
|
|
37
|
+
--slotted-calendar-cell-size,
|
|
38
|
+
calc(var(--slotted-control-height-md, 34px) + 2px)
|
|
39
|
+
);
|
|
40
|
+
/* Two pixels under the control: six weeks stand beside a clock. */
|
|
41
|
+
--_cell-block-size: var(
|
|
42
|
+
--slotted-calendar-cell-block-size,
|
|
43
|
+
max(var(--slotted-target-min, 24px), calc(var(--slotted-control-height-md, 34px) - 2px))
|
|
44
|
+
);
|
|
45
|
+
/* The page triggers, a step under the control, so the header is one row of text. */
|
|
46
|
+
--_trigger-size: max(
|
|
47
|
+
var(--slotted-target-min, 24px),
|
|
48
|
+
calc(var(--slotted-control-height-md, 34px) - 6px)
|
|
49
|
+
);
|
|
50
|
+
--_day-radius: var(--slotted-calendar-day-radius, var(--slotted-radius-md, 6px));
|
|
51
|
+
/** Seven days, three months, three years: the shape of the three views. */
|
|
39
52
|
--_columns: 7;
|
|
40
53
|
--_months: 1;
|
|
41
|
-
--_month-gap: var(--slotted-space-6, 1rem);
|
|
54
|
+
--_month-gap: var(--slotted-calendar-month-gap, calc(var(--slotted-space-6, 1rem) * 2));
|
|
42
55
|
/** The week number is a column of its own when a product asks for one. */
|
|
43
56
|
--_week-number-columns: 0;
|
|
44
57
|
--_grid-size: calc(var(--_cell-size) * (var(--_columns) + var(--_week-number-columns)));
|
|
@@ -73,8 +86,8 @@
|
|
|
73
86
|
* month nobody can read above a grid whose only subject is that month.
|
|
74
87
|
* `contain: inline-size` means the contents cannot ask for the room
|
|
75
88
|
* themselves, so the floor is stated: twenty characters of the heading's
|
|
76
|
-
* own type, the
|
|
77
|
-
*
|
|
89
|
+
* own type, the two glyph boxes of the triggers and the gaps beside
|
|
90
|
+
* them. It is written in `ch` and in the icon scale
|
|
78
91
|
* rather than in pixels, so it moves with the type and with density instead
|
|
79
92
|
* of being a guess that is right at one step.
|
|
80
93
|
*
|
|
@@ -83,7 +96,7 @@
|
|
|
83
96
|
* enough to keep the name readable, and `grids` centers the month under the
|
|
84
97
|
* row it belongs to.
|
|
85
98
|
*/
|
|
86
|
-
--_heading-floor: calc(20ch +
|
|
99
|
+
--_heading-floor: calc(20ch + 2 * var(--_icon-size) + 2 * var(--slotted-control-gap-md, 8px));
|
|
87
100
|
|
|
88
101
|
inline-size: max(
|
|
89
102
|
calc(var(--_grid-size) * var(--_months) + var(--_month-gap) * (var(--_months) - 1)),
|
|
@@ -131,24 +144,28 @@
|
|
|
131
144
|
--_cell-size: clamp(
|
|
132
145
|
var(--slotted-target-min, 24px),
|
|
133
146
|
calc(100cqi / (var(--_columns) + var(--_week-number-columns)) / var(--_months)),
|
|
134
|
-
var(--slotted-calendar-cell-size, var(--slotted-control-height-md, 34px))
|
|
147
|
+
var(--slotted-calendar-cell-size, calc(var(--slotted-control-height-md, 34px) + 2px))
|
|
135
148
|
);
|
|
136
149
|
}
|
|
137
150
|
|
|
138
151
|
/* ── The heading row ──────────────────────────────────────────────────
|
|
139
152
|
*
|
|
140
|
-
* The month
|
|
141
|
-
*
|
|
142
|
-
*
|
|
153
|
+
* The name of a month between the two triggers that page it. Two months
|
|
154
|
+
* share the pair: previous stands on the first and next on the last, and the
|
|
155
|
+
* three columns keep each name over the middle of its own grid.
|
|
143
156
|
*/
|
|
144
157
|
[data-ui-calendar] [data-part-header] {
|
|
145
158
|
align-items: center;
|
|
146
|
-
display:
|
|
147
|
-
|
|
159
|
+
display: grid;
|
|
160
|
+
grid-template-columns: var(--_trigger-size) minmax(0, 1fr) var(--_trigger-size);
|
|
148
161
|
/* The row is as wide as the grid under it, so the two triggers sit over
|
|
149
162
|
the first and last columns rather than floating above the middle. */
|
|
150
163
|
inline-size: 100%;
|
|
151
|
-
|
|
164
|
+
min-block-size: var(--_trigger-size);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
[data-ui-calendar] [data-part-next] {
|
|
168
|
+
grid-column: 3;
|
|
152
169
|
}
|
|
153
170
|
|
|
154
171
|
/**
|
|
@@ -166,59 +183,30 @@
|
|
|
166
183
|
border-radius: var(--slotted-calendar-radius, var(--slotted-control-radius, 4px));
|
|
167
184
|
color: inherit;
|
|
168
185
|
cursor: pointer;
|
|
169
|
-
display:
|
|
170
|
-
align-items: center;
|
|
171
|
-
gap: var(--slotted-space-2, 0.25rem);
|
|
186
|
+
display: block;
|
|
172
187
|
font: inherit;
|
|
188
|
+
font-size: var(--slotted-font-size-md, 0.875rem);
|
|
173
189
|
font-weight: var(--slotted-font-weight-semibold, 600);
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
* against a seven-column grid of 238, so without this the trigger at the
|
|
178
|
-
* end fell to a second line.
|
|
179
|
-
*
|
|
180
|
-
* The first capture of this family showed the opposite failure, and it is
|
|
181
|
-
* worth naming because the two look like the same rule: the heading read
|
|
182
|
-
* `d`, one character, with the grid overflowing under it. That was the
|
|
183
|
-
* root's `inline-size: fit-content` under `contain: inline-size`, not this
|
|
184
|
-
* — a contained root has no contents to be sized by, so it collapsed and
|
|
185
|
-
* took the heading with it. With the root's width stated, shrinking here
|
|
186
|
-
* is bounded by the grid and stops long before a character.
|
|
187
|
-
*/
|
|
188
|
-
flex: 1 1 auto;
|
|
189
|
-
/**
|
|
190
|
-
* `safe`, and it is the whole difference between a month that is cut and a
|
|
191
|
-
* month that is unreadable.
|
|
192
|
-
*
|
|
193
|
-
* Centerd without it, an overflowing heading is clipped at **both** ends:
|
|
194
|
-
* at `dense` the row read `etembro de 2026` with the view mark sliced off,
|
|
195
|
-
* which is a month nobody can read above a grid whose only subject is that
|
|
196
|
-
* month. `safe` falls back to start alignment exactly when the item would
|
|
197
|
-
* overflow, so the name always begins where it begins and only its tail is
|
|
198
|
-
* lost. Found from `datetime-picker`'s panel, reproduced on this family
|
|
199
|
-
* alone at `dense` and 720 pixels.
|
|
200
|
-
*
|
|
201
|
-
* `text-overflow: ellipsis` stood here and did nothing: it applies to the
|
|
202
|
-
* inline content of a block container, and the label is an anonymous flex
|
|
203
|
-
* item beside the mark. It is removed rather than left to look like a
|
|
204
|
-
* guard that is holding.
|
|
205
|
-
*/
|
|
206
|
-
justify-content: safe center;
|
|
190
|
+
grid-column: 2;
|
|
191
|
+
justify-self: center;
|
|
192
|
+
max-inline-size: 100%;
|
|
207
193
|
min-inline-size: 0;
|
|
208
|
-
padding
|
|
209
|
-
padding-inline: var(--slotted-space-2, 0.25rem);
|
|
194
|
+
padding: var(--slotted-space-1, 0.125rem) var(--slotted-space-3, 0.375rem);
|
|
210
195
|
/* One line, whatever the locale writes: a month name that wrapped would
|
|
211
|
-
take the grid down with it. */
|
|
196
|
+
take the grid down with it, and one that does not fit loses its tail. */
|
|
212
197
|
overflow: hidden;
|
|
198
|
+
text-overflow: ellipsis;
|
|
213
199
|
white-space: nowrap;
|
|
214
200
|
transition: background-color var(--slotted-control-transition-duration)
|
|
215
201
|
var(--slotted-control-transition-easing);
|
|
216
202
|
-webkit-tap-highlight-color: transparent;
|
|
217
203
|
}
|
|
218
204
|
|
|
219
|
-
/*
|
|
220
|
-
|
|
221
|
-
|
|
205
|
+
/* What the locale writes around the name, lighter than the name. */
|
|
206
|
+
[data-ui-calendar] [data-part-heading-rest] {
|
|
207
|
+
color: var(--slotted-calendar-heading-rest-color, var(--slotted-text-muted, GrayText));
|
|
208
|
+
font-weight: var(--slotted-font-weight-regular, 400);
|
|
209
|
+
}
|
|
222
210
|
|
|
223
211
|
/* ── The two page triggers ────────────────────────────────────────────
|
|
224
212
|
*
|
|
@@ -233,14 +221,13 @@
|
|
|
233
221
|
align-items: center;
|
|
234
222
|
appearance: none;
|
|
235
223
|
background-color: transparent;
|
|
236
|
-
block-size: var(--
|
|
224
|
+
block-size: var(--_trigger-size);
|
|
237
225
|
border: 0;
|
|
238
226
|
border-radius: var(--slotted-calendar-radius, var(--slotted-control-radius, 4px));
|
|
239
227
|
color: var(--slotted-calendar-trigger-color, var(--slotted-text-muted, GrayText));
|
|
240
228
|
cursor: pointer;
|
|
241
229
|
display: inline-flex;
|
|
242
|
-
|
|
243
|
-
inline-size: var(--_cell-size);
|
|
230
|
+
inline-size: var(--_trigger-size);
|
|
244
231
|
justify-content: center;
|
|
245
232
|
padding: 0;
|
|
246
233
|
touch-action: manipulation;
|
|
@@ -292,9 +279,8 @@
|
|
|
292
279
|
}
|
|
293
280
|
|
|
294
281
|
/**
|
|
295
|
-
* The month's own name
|
|
296
|
-
*
|
|
297
|
-
* reaching the grid still needs it.
|
|
282
|
+
* The month's own name, out of the picture and not out of the document: the
|
|
283
|
+
* heading above shows it, and it names the grid where there is no heading.
|
|
298
284
|
*/
|
|
299
285
|
[data-ui-calendar] [data-part-grid-caption] {
|
|
300
286
|
block-size: 1px;
|
|
@@ -305,32 +291,13 @@
|
|
|
305
291
|
white-space: nowrap;
|
|
306
292
|
}
|
|
307
293
|
|
|
308
|
-
/**
|
|
309
|
-
* With more than one month it is shown, because the heading then names the
|
|
310
|
-
* span rather than a month and nothing else would say which grid is which.
|
|
311
|
-
* A reader looking at two grids and one title has to count columns to find
|
|
312
|
-
* out where October starts.
|
|
313
|
-
*/
|
|
314
|
-
[data-ui-calendar][data-part-root]:is([data-months='2'], [data-months='3'])
|
|
315
|
-
[data-part-grid-caption] {
|
|
316
|
-
block-size: auto;
|
|
317
|
-
clip-path: none;
|
|
318
|
-
color: var(--slotted-calendar-weekday-color, var(--slotted-text-muted, GrayText));
|
|
319
|
-
font-size: var(--slotted-font-size-xs, 0.75rem);
|
|
320
|
-
font-weight: var(--slotted-font-weight-semibold, 600);
|
|
321
|
-
inline-size: auto;
|
|
322
|
-
overflow: visible;
|
|
323
|
-
padding-block-end: var(--slotted-space-2, 0.25rem);
|
|
324
|
-
position: static;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
294
|
/**
|
|
328
295
|
* The weekday. Two characters is what a column can hold; the full name
|
|
329
296
|
* reaches assistive technology through `abbr`, which is the APG's own
|
|
330
297
|
* answer and the difference between hearing "Mo" and hearing "Monday".
|
|
331
298
|
*/
|
|
332
299
|
[data-ui-calendar] [data-part-week-header] {
|
|
333
|
-
block-size: var(--
|
|
300
|
+
block-size: var(--slotted-target-min, 24px);
|
|
334
301
|
color: var(--slotted-calendar-weekday-color, var(--slotted-text-muted, GrayText));
|
|
335
302
|
font-size: var(--slotted-font-size-xs, 0.75rem);
|
|
336
303
|
font-weight: var(--slotted-font-weight-medium, 500);
|
|
@@ -350,9 +317,26 @@
|
|
|
350
317
|
and a column as wide as a day would read as an eighth day. */
|
|
351
318
|
inline-size: calc(var(--_cell-size) * 0.75);
|
|
352
319
|
padding: 0;
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/* The number as a press, where a week may be chosen whole. */
|
|
323
|
+
[data-ui-calendar] [data-part-week-choice] {
|
|
324
|
+
appearance: none;
|
|
325
|
+
background-color: transparent;
|
|
326
|
+
block-size: 100%;
|
|
327
|
+
border: 0;
|
|
328
|
+
border-radius: var(--_day-radius);
|
|
329
|
+
color: inherit;
|
|
330
|
+
cursor: pointer;
|
|
331
|
+
font: inherit;
|
|
332
|
+
font-variant-numeric: inherit;
|
|
333
|
+
inline-size: 100%;
|
|
334
|
+
min-block-size: var(--slotted-target-min, 24px);
|
|
335
|
+
padding: 0;
|
|
336
|
+
transition:
|
|
337
|
+
background-color var(--slotted-control-transition-duration)
|
|
338
|
+
var(--slotted-control-transition-easing),
|
|
339
|
+
color var(--slotted-control-transition-duration) var(--slotted-control-transition-easing);
|
|
356
340
|
}
|
|
357
341
|
|
|
358
342
|
[data-ui-calendar] [data-part-cell] {
|
|
@@ -365,44 +349,28 @@
|
|
|
365
349
|
* The day the reader presses.
|
|
366
350
|
*
|
|
367
351
|
* It is the `td`'s child rather than the `td` itself, because the range band
|
|
368
|
-
* has to run edge to edge across a cell while the day itself stays a
|
|
369
|
-
* inside it — two shapes, and one element cannot be both.
|
|
352
|
+
* has to run edge to edge across a cell while the day itself stays a rounded
|
|
353
|
+
* box inside it — two shapes, and one element cannot be both.
|
|
370
354
|
*/
|
|
371
355
|
[data-ui-calendar] [data-part-day] {
|
|
372
356
|
/**
|
|
373
|
-
* A rule short of the cell
|
|
374
|
-
*
|
|
375
|
-
* Two chosen days side by side are two solid boxes, and filling the cell
|
|
376
|
-
* put their rounded corners against each other with no air between —
|
|
377
|
-
* which reads as one shape with a dent rather than as two days. The inset
|
|
378
|
-
* is taken everywhere rather than only where it shows, so no day is a
|
|
379
|
-
* different size from the day beside it.
|
|
357
|
+
* A rule short of the cell above and below, so a week stands apart from
|
|
358
|
+
* the next one and a band keeps the same air as the days on it.
|
|
380
359
|
*/
|
|
381
360
|
--_inset: var(--slotted-border-width-thin, 1px);
|
|
382
361
|
|
|
383
362
|
align-items: center;
|
|
384
|
-
block-size: calc(var(--_cell-size) - var(--_inset) * 2);
|
|
385
|
-
inline-size:
|
|
386
|
-
margin: var(--_inset);
|
|
387
|
-
border-radius: var(--
|
|
363
|
+
block-size: calc(var(--_cell-block-size) - var(--_inset) * 2);
|
|
364
|
+
inline-size: var(--_cell-size);
|
|
365
|
+
margin-block: var(--_inset);
|
|
366
|
+
border-radius: var(--_day-radius);
|
|
388
367
|
box-sizing: border-box;
|
|
389
368
|
color: inherit;
|
|
390
369
|
cursor: pointer;
|
|
391
370
|
display: flex;
|
|
392
371
|
font-variant-numeric: tabular-nums;
|
|
393
|
-
/**
|
|
394
|
-
* A column, and the second row is today's dot — reserved in every cell,
|
|
395
|
-
* painted in one. Left to today alone the mark either overlapped the digit
|
|
396
|
-
* or moved it, and a month whose ninth sits two pixels higher than its
|
|
397
|
-
* tenth is a month with a dent in it.
|
|
398
|
-
*/
|
|
399
372
|
flex-direction: column;
|
|
400
|
-
/* The digit and the dot are not the same thing, and a mark against the
|
|
401
|
-
descender of a nine reads as part of it. */
|
|
402
|
-
gap: var(--slotted-space-1, 0.125rem);
|
|
403
373
|
justify-content: center;
|
|
404
|
-
/* The digit's own box, and nothing more: the leading a paragraph needs is
|
|
405
|
-
air the cell has to give to the dot instead. */
|
|
406
374
|
line-height: 1;
|
|
407
375
|
/* Above the range band, which is painted on the cell behind it. */
|
|
408
376
|
position: relative;
|
|
@@ -428,7 +396,7 @@
|
|
|
428
396
|
|
|
429
397
|
/* ── The month and year views ─────────────────────────────────────────
|
|
430
398
|
*
|
|
431
|
-
*
|
|
399
|
+
* Three columns rather than seven, and a cell wide enough for a month's whole
|
|
432
400
|
* name. A reader entering a birth date must not press "previous month" four
|
|
433
401
|
* hundred times, which is what these two exist to prevent.
|
|
434
402
|
*/
|
|
@@ -436,25 +404,31 @@
|
|
|
436
404
|
[data-ui-calendar] [data-part-years] {
|
|
437
405
|
display: grid;
|
|
438
406
|
gap: var(--slotted-space-2, 0.25rem);
|
|
439
|
-
grid-template-columns: repeat(
|
|
407
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
408
|
+
padding-block-start: var(--slotted-space-2, 0.25rem);
|
|
440
409
|
/* The same box the day grid occupies, so switching view does not resize
|
|
441
410
|
the surface the reader is looking at. */
|
|
442
411
|
inline-size: calc(var(--_cell-size) * var(--_columns));
|
|
412
|
+
max-inline-size: 100%;
|
|
443
413
|
}
|
|
444
414
|
|
|
445
415
|
[data-ui-calendar] [data-part-period] {
|
|
446
416
|
align-items: center;
|
|
447
417
|
appearance: none;
|
|
448
|
-
background-color:
|
|
449
|
-
|
|
418
|
+
background-color: var(
|
|
419
|
+
--slotted-calendar-period-background,
|
|
420
|
+
var(--slotted-surface-sunken, ButtonFace)
|
|
421
|
+
);
|
|
422
|
+
block-size: var(--slotted-calendar-period-block-size, var(--slotted-target-comfortable, 44px));
|
|
450
423
|
border: 0;
|
|
451
|
-
border-radius: var(--
|
|
424
|
+
border-radius: var(--_day-radius);
|
|
452
425
|
color: inherit;
|
|
453
426
|
cursor: pointer;
|
|
454
427
|
display: flex;
|
|
455
428
|
font: inherit;
|
|
456
429
|
justify-content: center;
|
|
457
|
-
|
|
430
|
+
min-inline-size: 0;
|
|
431
|
+
padding-inline: var(--slotted-space-1, 0.125rem);
|
|
458
432
|
transition:
|
|
459
433
|
background-color var(--slotted-control-transition-duration)
|
|
460
434
|
var(--slotted-control-transition-easing),
|
|
@@ -473,27 +447,34 @@
|
|
|
473
447
|
* Today. Marked apart from the selection, as §6 of the feature guide asks in
|
|
474
448
|
* those words: a reader who has chosen today must still see both facts.
|
|
475
449
|
*
|
|
476
|
-
* A
|
|
477
|
-
*
|
|
478
|
-
*
|
|
479
|
-
* it was. Two facts need two shapes. The dot is `currentcolor`, so it takes
|
|
480
|
-
* the ink of whatever state the day is in — the accent text at rest, the
|
|
481
|
-
* fill's own ink when the day is chosen, the disabled grey when nothing is
|
|
482
|
-
* operable — and it survives `forced-colors`, where `currentcolor` is
|
|
483
|
-
* already the system's ink.
|
|
450
|
+
* A thin outline inside the day, and focus is a ring outside it, so a reader
|
|
451
|
+
* arrowing onto today sees two shapes. A day with marks keeps both, and the
|
|
452
|
+
* `fill` layout, whose days are tall, keeps its dot or its disc.
|
|
484
453
|
*/
|
|
485
454
|
[data-ui-calendar] [data-part-day][data-today] {
|
|
486
455
|
color: var(--slotted-calendar-today-color, var(--slotted-tone-accent-text));
|
|
487
456
|
font-weight: var(--slotted-font-weight-semibold, 600);
|
|
488
457
|
}
|
|
489
458
|
|
|
459
|
+
[data-ui-calendar]:not([data-layout='fill'])
|
|
460
|
+
[data-part-cell]:not([data-selected], [data-range-start], [data-range-end])
|
|
461
|
+
> [data-part-day][data-today] {
|
|
462
|
+
box-shadow: inset 0 0 0 var(--slotted-border-width-thin, 1px)
|
|
463
|
+
var(--slotted-calendar-today-border-color, var(--slotted-tone-accent-border));
|
|
464
|
+
}
|
|
465
|
+
|
|
490
466
|
/* The disc says it, and the rest of the day keeps its own ink. */
|
|
491
467
|
[data-ui-calendar]:where([data-layout='fill'][data-today-mark='disc'])
|
|
492
468
|
[data-part-day][data-today] {
|
|
493
469
|
color: inherit;
|
|
494
470
|
}
|
|
495
471
|
|
|
496
|
-
[data-ui-calendar] [data-part-day]
|
|
472
|
+
[data-ui-calendar][data-layout='fill'] [data-part-day] {
|
|
473
|
+
/* The digit and the dot under it are not the same thing. */
|
|
474
|
+
gap: var(--slotted-space-1, 0.125rem);
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
[data-ui-calendar][data-layout='fill'] [data-part-day]::before {
|
|
497
478
|
/* Reserved in every cell and painted in one, so the row keeps its line. */
|
|
498
479
|
background-color: transparent;
|
|
499
480
|
block-size: var(--slotted-space-2, 0.25rem);
|
|
@@ -506,16 +487,16 @@
|
|
|
506
487
|
order: 1;
|
|
507
488
|
}
|
|
508
489
|
|
|
509
|
-
[data-ui-calendar] [data-part-day][data-today]::before {
|
|
490
|
+
[data-ui-calendar][data-layout='fill'] [data-part-day][data-today]::before {
|
|
510
491
|
background-color: currentcolor;
|
|
511
492
|
}
|
|
512
493
|
|
|
513
494
|
/**
|
|
514
|
-
* What falls on the day (`marks`): a dot in the
|
|
515
|
-
*
|
|
516
|
-
*
|
|
495
|
+
* What falls on the day (`marks`): a dot under the number, in the mark's
|
|
496
|
+
* tone. The number of a day is in the middle of its cell with a mark and
|
|
497
|
+
* without one; on a chosen day the dot takes the day's ink.
|
|
517
498
|
*/
|
|
518
|
-
[data-ui-calendar] [data-part-day]:has(> [data-part-mark])::before {
|
|
499
|
+
[data-ui-calendar][data-layout='fill'] [data-part-day]:has(> [data-part-mark])::before {
|
|
519
500
|
display: none;
|
|
520
501
|
}
|
|
521
502
|
|
|
@@ -530,6 +511,11 @@
|
|
|
530
511
|
order: 1;
|
|
531
512
|
}
|
|
532
513
|
|
|
514
|
+
[data-ui-calendar]:not([data-layout='fill']) [data-part-mark] {
|
|
515
|
+
inset-block-end: var(--slotted-space-1, 0.125rem);
|
|
516
|
+
position: absolute;
|
|
517
|
+
}
|
|
518
|
+
|
|
533
519
|
[data-ui-calendar] [data-part-mark][data-tone='info'] {
|
|
534
520
|
--_mark: var(--slotted-tone-info-solid, currentcolor);
|
|
535
521
|
}
|
|
@@ -559,6 +545,13 @@
|
|
|
559
545
|
color: var(--slotted-calendar-outside-color, var(--slotted-text-muted, GrayText));
|
|
560
546
|
}
|
|
561
547
|
|
|
548
|
+
/* The weakest ink of the six: a chosen, banded or marked day keeps its own. */
|
|
549
|
+
[data-ui-calendar]:where(:not([data-layout='fill'], [data-disabled]))
|
|
550
|
+
:where([data-part-cell][data-weekend])
|
|
551
|
+
[data-part-day] {
|
|
552
|
+
color: var(--slotted-calendar-weekend-color, var(--slotted-text-muted, GrayText));
|
|
553
|
+
}
|
|
554
|
+
|
|
562
555
|
/**
|
|
563
556
|
* Refused by the predicate. It stays focusable — `aria-disabled`, never
|
|
564
557
|
* `disabled` — so a reader can arrow onto it and be told why, and the strike
|
|
@@ -589,10 +582,10 @@
|
|
|
589
582
|
* from under both ends.
|
|
590
583
|
*
|
|
591
584
|
* The foundation already names the answer for a ground with no edge, and
|
|
592
|
-
* `highlight` already draws it:
|
|
593
|
-
*
|
|
594
|
-
*
|
|
595
|
-
*
|
|
585
|
+
* `highlight` already draws it: a tone mixed into the surface at the share
|
|
586
|
+
* `--slotted-highlight-tint-opacity` holds. A run takes twice the share, in
|
|
587
|
+
* the solid role its ends are filled with, so the band reads as theirs in
|
|
588
|
+
* both schemes, with nothing to align across a row break.
|
|
596
589
|
*/
|
|
597
590
|
[data-ui-calendar] [data-part-cell][data-in-range]::before,
|
|
598
591
|
[data-ui-calendar] [data-part-cell][data-range-start]::before,
|
|
@@ -601,12 +594,12 @@
|
|
|
601
594
|
--slotted-calendar-range-background,
|
|
602
595
|
color-mix(
|
|
603
596
|
in oklab,
|
|
604
|
-
var(--slotted-tone-accent-
|
|
597
|
+
var(--slotted-tone-accent-solid) calc(var(--slotted-highlight-tint-opacity, 0.075) * 200%),
|
|
605
598
|
transparent
|
|
606
599
|
)
|
|
607
600
|
);
|
|
608
601
|
content: '';
|
|
609
|
-
inset: 0;
|
|
602
|
+
inset: var(--slotted-border-width-thin, 1px) 0;
|
|
610
603
|
position: absolute;
|
|
611
604
|
}
|
|
612
605
|
|
|
@@ -616,41 +609,32 @@
|
|
|
616
609
|
* clipped rather than one that stops.
|
|
617
610
|
*/
|
|
618
611
|
[data-ui-calendar] [data-part-cell][data-range-start]::before {
|
|
619
|
-
border-end-start-radius: var(--
|
|
620
|
-
border-start-start-radius: var(--
|
|
612
|
+
border-end-start-radius: var(--_day-radius);
|
|
613
|
+
border-start-start-radius: var(--_day-radius);
|
|
621
614
|
}
|
|
622
615
|
|
|
623
616
|
[data-ui-calendar] [data-part-cell][data-range-end]::before {
|
|
624
|
-
border-end-end-radius: var(--
|
|
625
|
-
border-start-end-radius: var(--
|
|
617
|
+
border-end-end-radius: var(--_day-radius);
|
|
618
|
+
border-start-end-radius: var(--_day-radius);
|
|
626
619
|
}
|
|
627
620
|
|
|
628
621
|
/**
|
|
629
|
-
*
|
|
630
|
-
*
|
|
631
|
-
* faces out keeps the day's own radius. A range of one day is both ends at
|
|
632
|
-
* once and stays round on both sides, which is why each rule excludes the
|
|
633
|
-
* other.
|
|
622
|
+
* The band closes where the row does, and where the month does: a week, or a
|
|
623
|
+
* month with nothing drawn beyond it, ends the band as the run would.
|
|
634
624
|
*/
|
|
635
|
-
[data-ui-calendar]
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
border-end-start-radius: 0;
|
|
642
|
-
border-start-start-radius: 0;
|
|
625
|
+
[data-ui-calendar]:not([data-layout='fill']) [data-part-cell]:first-of-type::before,
|
|
626
|
+
[data-ui-calendar]:not([data-layout='fill'])
|
|
627
|
+
[data-part-cell][data-outside-month]:empty
|
|
628
|
+
+ [data-part-cell]::before {
|
|
629
|
+
border-end-start-radius: var(--_day-radius);
|
|
630
|
+
border-start-start-radius: var(--_day-radius);
|
|
643
631
|
}
|
|
644
632
|
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
[data-ui-calendar]
|
|
651
|
-
[data-part-cell]:is([data-in-range], [data-range-start], [data-range-end])
|
|
652
|
-
[data-part-day] {
|
|
653
|
-
--_inset: 0px;
|
|
633
|
+
[data-ui-calendar]:not([data-layout='fill']) [data-part-cell]:last-of-type::before,
|
|
634
|
+
[data-ui-calendar]:not([data-layout='fill'])
|
|
635
|
+
[data-part-cell]:has(+ [data-part-cell][data-outside-month]:empty)::before {
|
|
636
|
+
border-end-end-radius: var(--_day-radius);
|
|
637
|
+
border-start-end-radius: var(--_day-radius);
|
|
654
638
|
}
|
|
655
639
|
|
|
656
640
|
/**
|
|
@@ -659,8 +643,7 @@
|
|
|
659
643
|
* scheme where the band is faint, and it is the second half of the pair the
|
|
660
644
|
* foundation asks for where there is no edge to make one with.
|
|
661
645
|
*/
|
|
662
|
-
[data-ui-calendar] [data-part-cell][data-in-range] [data-part-day] {
|
|
663
|
-
border-radius: 0;
|
|
646
|
+
[data-ui-calendar] [data-part-cell][data-in-range]:not([data-unavailable]) [data-part-day] {
|
|
664
647
|
color: var(--slotted-calendar-in-range-color, var(--slotted-tone-accent-text));
|
|
665
648
|
}
|
|
666
649
|
|
|
@@ -679,7 +662,7 @@
|
|
|
679
662
|
--slotted-calendar-preview-background,
|
|
680
663
|
color-mix(
|
|
681
664
|
in oklab,
|
|
682
|
-
var(--slotted-tone-accent-
|
|
665
|
+
var(--slotted-tone-accent-solid) calc(var(--slotted-highlight-tint-opacity, 0.075) * 100%),
|
|
683
666
|
transparent
|
|
684
667
|
)
|
|
685
668
|
);
|
|
@@ -693,6 +676,28 @@
|
|
|
693
676
|
color: var(--slotted-calendar-in-range-color, var(--slotted-tone-accent-text));
|
|
694
677
|
}
|
|
695
678
|
|
|
679
|
+
/* ── Past the limit ───────────────────────────────────────────────────
|
|
680
|
+
*
|
|
681
|
+
* The days of a run longer than it may be, in the danger tone: the band, the
|
|
682
|
+
* numbers on it, and the end that closes it.
|
|
683
|
+
*/
|
|
684
|
+
[data-ui-calendar] [data-part-cell][data-over]::before {
|
|
685
|
+
background-color: var(
|
|
686
|
+
--slotted-calendar-over-background,
|
|
687
|
+
color-mix(
|
|
688
|
+
in oklab,
|
|
689
|
+
var(--slotted-tone-danger-solid) calc(var(--slotted-highlight-tint-opacity, 0.075) * 200%),
|
|
690
|
+
transparent
|
|
691
|
+
)
|
|
692
|
+
);
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
[data-ui-calendar]
|
|
696
|
+
[data-part-cell][data-over][data-in-range]:not([data-unavailable])
|
|
697
|
+
[data-part-day] {
|
|
698
|
+
color: var(--slotted-calendar-over-color, var(--slotted-tone-danger-text));
|
|
699
|
+
}
|
|
700
|
+
|
|
696
701
|
/* ── States ───────────────────────────────────────────────────────────
|
|
697
702
|
*
|
|
698
703
|
* Written strongest last, and each weaker one guarded against every stronger
|
|
@@ -700,6 +705,7 @@
|
|
|
700
705
|
*/
|
|
701
706
|
|
|
702
707
|
[data-ui-calendar] [data-part-day]:hover:not([data-disabled]),
|
|
708
|
+
[data-ui-calendar] [data-part-week-choice]:hover:not(:disabled):not([data-disabled]),
|
|
703
709
|
[data-ui-calendar] [data-part-period]:hover:not(:disabled):not([data-disabled]),
|
|
704
710
|
[data-ui-calendar] [data-part-heading]:hover:not(:disabled):not([data-disabled]),
|
|
705
711
|
[data-ui-calendar] [data-part-previous]:hover:not(:disabled):not([data-disabled]),
|
|
@@ -774,17 +780,39 @@
|
|
|
774
780
|
font-weight: var(--slotted-font-weight-semibold, 600);
|
|
775
781
|
}
|
|
776
782
|
|
|
783
|
+
[data-ui-calendar] [data-part-cell][data-over][data-selected] [data-part-day] {
|
|
784
|
+
background-color: var(
|
|
785
|
+
--slotted-calendar-over-selected-background,
|
|
786
|
+
var(--slotted-tone-danger-solid)
|
|
787
|
+
);
|
|
788
|
+
color: var(--slotted-calendar-over-selected-color, var(--slotted-tone-danger-on-solid));
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
/* Two chosen days side by side are two boxes: each gives the other a rule of air. */
|
|
792
|
+
[data-ui-calendar]:not([data-layout='fill'])
|
|
793
|
+
[data-part-cell][data-selected]:not([data-range-start], [data-range-end])
|
|
794
|
+
[data-part-day] {
|
|
795
|
+
inline-size: calc(var(--_cell-size) - var(--_inset) * 2);
|
|
796
|
+
margin-inline: var(--_inset);
|
|
797
|
+
}
|
|
798
|
+
|
|
777
799
|
[data-ui-calendar] [data-part-day]:focus-visible,
|
|
778
800
|
[data-ui-calendar] [data-part-period]:focus-visible,
|
|
801
|
+
[data-ui-calendar] [data-part-week-choice]:focus-visible,
|
|
779
802
|
[data-ui-calendar] [data-part-heading]:focus-visible,
|
|
780
803
|
[data-ui-calendar] [data-part-previous]:focus-visible,
|
|
781
804
|
[data-ui-calendar] [data-part-next]:focus-visible {
|
|
782
805
|
outline: var(--slotted-focus-ring-width, 2px) solid var(--slotted-focus-ring-color, Highlight);
|
|
783
|
-
/* Inside the cell rather than outside it: an offset ring on a grid of
|
|
784
|
-
touching cells would overlap the four neighbours and read as a smear. */
|
|
785
806
|
outline-offset: calc(var(--slotted-focus-ring-offset, 2px) * -1);
|
|
786
807
|
}
|
|
787
808
|
|
|
809
|
+
/* Outside the day, where today's outline and the chosen ground are not, and
|
|
810
|
+
over its neighbours so the ring is never cut by one. */
|
|
811
|
+
[data-ui-calendar]:not([data-layout='fill'], [data-invalid]) [data-part-day]:focus-visible {
|
|
812
|
+
outline-offset: var(--slotted-border-width-thin, 1px);
|
|
813
|
+
z-index: 1;
|
|
814
|
+
}
|
|
815
|
+
|
|
788
816
|
[data-ui-calendar][data-part-root][data-invalid] {
|
|
789
817
|
--slotted-focus-ring-color: var(
|
|
790
818
|
--slotted-calendar-invalid-focus-ring-color,
|
|
@@ -828,6 +856,7 @@
|
|
|
828
856
|
me": today keeps its dot, in the ink a disabled control is allowed. */
|
|
829
857
|
[data-ui-calendar][data-part-root][data-disabled] [data-part-day][data-today] {
|
|
830
858
|
color: var(--slotted-disabled-foreground);
|
|
859
|
+
--slotted-calendar-today-border-color: var(--slotted-disabled-foreground);
|
|
831
860
|
}
|
|
832
861
|
|
|
833
862
|
[data-ui-calendar][data-part-root][data-disabled]
|
|
@@ -884,6 +913,15 @@
|
|
|
884
913
|
var(--slotted-calendar-range-border-color, var(--slotted-tone-accent-border));
|
|
885
914
|
}
|
|
886
915
|
|
|
916
|
+
/* The system draws a plate behind a text it forces, and the ink of a chosen
|
|
917
|
+
day is the plate's own color. */
|
|
918
|
+
[data-ui-calendar] [data-part-cell][data-selected] [data-part-day],
|
|
919
|
+
[data-ui-calendar] [data-part-period][data-selected] {
|
|
920
|
+
background-color: Highlight;
|
|
921
|
+
color: HighlightText;
|
|
922
|
+
forced-color-adjust: none;
|
|
923
|
+
}
|
|
924
|
+
|
|
887
925
|
/* A proposal keeps its own distance from a choice here too: the pending
|
|
888
926
|
band's edges are dashed where the chosen run's are solid. */
|
|
889
927
|
[data-ui-calendar] [data-part-cell][data-preview]::before {
|
|
@@ -912,6 +950,7 @@
|
|
|
912
950
|
}
|
|
913
951
|
|
|
914
952
|
[data-ui-calendar][data-layout='fill'] [data-part-day] {
|
|
953
|
+
margin: var(--_inset);
|
|
915
954
|
block-size: calc(
|
|
916
955
|
var(--slotted-calendar-day-height, calc(var(--_cell-size) * 2)) - var(--_inset) * 2
|
|
917
956
|
);
|