calendar-components 0.0.0 → 0.7.3

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.
@@ -0,0 +1,817 @@
1
+ /*
2
+ * iOS Calendar's day and multi-day views, to the point: measured from an
3
+ * iPhone (440pt wide, iOS 26). An hour is 53pt; set `hourHeight={53}`.
4
+ *
5
+ * gutter 62pt, the hour set right against it: a number, then a small "AM"
6
+ * an event starts 6pt in from the gutter and stops 3pt short of the edge,
7
+ * 1pt under its hour's line, with 4pt corners
8
+ * its bar is 3pt wide with round ends, 4pt in from the event's edge
9
+ * its wash, name and time are all cuts of its one colour
10
+ */
11
+ .calendar-apple {
12
+ /* These are the app's own light colours: the system's (Canvas, form controls) stay light with them. */
13
+ color-scheme: light;
14
+ --calendar-font: 15px / 1.2 -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, system-ui, sans-serif;
15
+ --calendar-gutter: 62px;
16
+ --calendar-line: rgb(60 60 67 / 0.16);
17
+ --calendar-muted: rgb(60 60 67 / 0.6);
18
+ /* System red as an iPhone shows it. */
19
+ --calendar-today: #eb4b46;
20
+ --calendar-color: #82fb66;
21
+ }
22
+ .calendar-apple [data-slot="time-grid-hour"] {
23
+ transform: translateY(-58%);
24
+ padding-inline-end: 6px;
25
+ font-size: 14px;
26
+ font-weight: 400;
27
+ color: rgb(60 60 67 / 0.85);
28
+ }
29
+ .calendar-apple [data-slot="time-grid-hour"] .calendar-period {
30
+ margin-inline-start: 3px;
31
+ font-size: 9px;
32
+ font-weight: 500;
33
+ color: rgb(60 60 67 / 0.4);
34
+ }
35
+ .calendar-apple [data-slot="time-grid-hour"][data-noon] {
36
+ transform: translateY(-50%);
37
+ font-size: 12px;
38
+ font-weight: 600;
39
+ color: rgb(60 60 67 / 0.8);
40
+ }
41
+ .calendar-apple [data-slot="time-grid-column"] {
42
+ border-inline-start: 0;
43
+ }
44
+ .calendar-apple [data-slot="time-grid-column"] + [data-slot="time-grid-column"] {
45
+ border-inline-start: 1px solid var(--calendar-line);
46
+ }
47
+ /*
48
+ * One day at a time, with the others a swipe away (`calendar-paged` with one day shown): add
49
+ * `calendar-one-day`, and each is drawn as a day alone is, with no line between it and the hours.
50
+ */
51
+ .calendar-apple.calendar-one-day [data-slot="time-grid-column"] + [data-slot="time-grid-column"] {
52
+ border-inline-start: 0;
53
+ }
54
+
55
+ .calendar-apple [data-slot="time-grid-event"] {
56
+ /* The space round an event is a clear border: 1pt over, 2pt under, 6pt before and 3pt after. */
57
+ border-style: solid;
58
+ border-color: transparent;
59
+ border-block-width: 1px 2px;
60
+ border-inline-width: 6px 3px;
61
+ /* 4pt corners on what is seen: each outer radius is 4pt more than the clear border beside it. */
62
+ border-start-start-radius: 10px 5px;
63
+ border-start-end-radius: 7px 5px;
64
+ border-end-end-radius: 7px 6px;
65
+ border-end-start-radius: 10px 6px;
66
+ padding-block: 1.67px 4px;
67
+ padding-inline: 11.33px 8px;
68
+ color: color-mix(in srgb, var(--calendar-color) 75%, black);
69
+ /* A wash you can see the hour lines through, as iOS has it. */
70
+ background-color: color-mix(in srgb, var(--calendar-color) 21%, transparent);
71
+ }
72
+ .calendar-apple [data-slot="time-grid-event"]::before {
73
+ content: "";
74
+ position: absolute;
75
+ inset-block: 4px;
76
+ inset-inline-start: 4px;
77
+ width: 3px;
78
+ border-radius: 1.5px;
79
+ background: var(--calendar-color);
80
+ }
81
+ .calendar-apple [data-slot="time-grid-event"] > [data-slot="time-grid-event-content"] > :first-child {
82
+ font-size: 13px;
83
+ line-height: 17px;
84
+ font-weight: 600;
85
+ color: color-mix(in srgb, var(--calendar-color) 50%, black);
86
+ }
87
+ .calendar-apple [data-slot="time-grid-event"] > [data-slot="time-grid-event-content"] > :not(:first-child) {
88
+ font-size: 11px;
89
+ line-height: 14px;
90
+ letter-spacing: 0.01em;
91
+ }
92
+ .calendar-apple [data-slot="time-grid-event"][data-selected] {
93
+ color: white;
94
+ background-color: color-mix(in srgb, var(--calendar-color) 92%, white);
95
+ }
96
+ .calendar-apple [data-slot="time-grid-event"][data-selected] > [data-slot="time-grid-event-content"] > :first-child {
97
+ color: white;
98
+ }
99
+ .calendar-apple [data-slot="time-grid-event"][data-selected]::before {
100
+ display: none;
101
+ }
102
+
103
+ /*
104
+ * Several days side by side (measured from the two-day view; set
105
+ * `hourHeight={50}` there): each day's name in a 37pt band, 16pt semibold,
106
+ * over a 1pt rule, with the lines between days running up through it; an
107
+ * event 2.67pt in from both edges of its day.
108
+ */
109
+ .calendar-apple [data-slot="time-grid-day-header"] {
110
+ padding: 6.67px 0 9.33px;
111
+ font-size: 16px;
112
+ line-height: 20px;
113
+ font-weight: 600;
114
+ border-inline-start: 1px solid #e7e7e8;
115
+ border-bottom: 1px solid #e7e7e8;
116
+ }
117
+ .calendar-apple .calendar-corner {
118
+ border-bottom: 1px solid #e7e7e8;
119
+ }
120
+ .calendar-apple.calendar-week:not(.calendar-one-day):has([data-slot="time-grid-column"] ~ [data-slot="time-grid-column"]) {
121
+ --calendar-gutter: 61px;
122
+ --calendar-line: #e7e7e8;
123
+ }
124
+ .calendar-apple.calendar-week:not(.calendar-one-day):has([data-slot="time-grid-column"] ~ [data-slot="time-grid-column"]) [data-slot="time-grid-column"] {
125
+ border-inline-start: 1px solid var(--calendar-line);
126
+ }
127
+ /* Room over the first hour (`--calendar-lead`), with each day's line running up through it. */
128
+ .calendar-apple [data-slot="time-grid-hours"],
129
+ .calendar-apple [data-slot="time-grid-column"] {
130
+ margin-top: var(--calendar-lead, 0px);
131
+ }
132
+ .calendar-apple.calendar-week:not(.calendar-one-day):has([data-slot="time-grid-column"] ~ [data-slot="time-grid-column"]) [data-slot="time-grid-column"]::before {
133
+ content: "";
134
+ position: absolute;
135
+ bottom: 100%;
136
+ inset-inline: -1px 0;
137
+ height: var(--calendar-lead, 0px);
138
+ box-sizing: border-box;
139
+ border-inline-start: 1px solid var(--calendar-line);
140
+ }
141
+ .calendar-apple.calendar-week:not(.calendar-one-day):has([data-slot="time-grid-column"] ~ [data-slot="time-grid-column"]) [data-slot="time-grid-event"] {
142
+ border-block-width: 1px 2px;
143
+ border-inline-width: 2.67px;
144
+ border-radius: 6.67px / 5px 5px 6px 6px;
145
+ }
146
+ .calendar-apple.calendar-week:not(.calendar-one-day):has([data-slot="time-grid-column"] ~ [data-slot="time-grid-column"]) [data-slot="time-grid-hour"]:not([data-noon]) {
147
+ padding-inline-end: 4.67px;
148
+ font-size: 14px;
149
+ }
150
+ .calendar-apple.calendar-week:not(.calendar-one-day):has([data-slot="time-grid-column"] ~ [data-slot="time-grid-column"]) [data-slot="time-grid-hour"] .calendar-period {
151
+ margin-inline-start: 2.33px;
152
+ }
153
+ .calendar-apple [data-slot="time-grid-now"] {
154
+ height: 1px;
155
+ background: var(--calendar-today);
156
+ }
157
+ .calendar-apple [data-slot="time-grid-now"]::before {
158
+ content: "";
159
+ position: absolute;
160
+ inset-inline-start: -4px;
161
+ top: -3.5px;
162
+ width: 8px;
163
+ height: 8px;
164
+ border-radius: 50%;
165
+ background: var(--calendar-today);
166
+ }
167
+
168
+ /*
169
+ * The strip of days over the grid: a letter for each weekday, and under it
170
+ * the date. The selected day is a black disc with a white number, today's
171
+ * number is red (a red disc when today is selected), and the weekend's days
172
+ * are grey.
173
+ */
174
+ /* A rule closes the strip, 10.33pt under its discs. */
175
+ .calendar-apple[data-slot="date-grid"] {
176
+ padding: 0 0 10.33px;
177
+ border-bottom: 1px solid var(--calendar-line);
178
+ }
179
+ .calendar-apple [data-slot="date-grid-grid"] {
180
+ width: 100%;
181
+ border-collapse: collapse;
182
+ table-layout: fixed;
183
+ }
184
+ .calendar-apple [data-slot="date-grid-header-cell"] {
185
+ padding: 0 0 5px;
186
+ font-size: 10px;
187
+ line-height: 7px;
188
+ font-weight: 600;
189
+ color: CanvasText;
190
+ }
191
+ .calendar-apple [data-slot="date-grid-header-cell"][data-weekend] {
192
+ color: rgb(60 60 67 / 0.5);
193
+ }
194
+ .calendar-apple [data-slot="date-grid-cell-wrapper"] {
195
+ padding: 0;
196
+ text-align: center;
197
+ }
198
+ .calendar-apple [data-slot="date-grid-cell"] {
199
+ /* Measured from iOS: a 35pt disc, 9.33pt under the weekday's letter, its number 18pt. */
200
+ display: inline-grid;
201
+ place-items: center;
202
+ width: 35px;
203
+ height: 35px;
204
+ margin-top: 2.67px;
205
+ border-radius: 50%;
206
+ font-size: 18px;
207
+ cursor: default;
208
+ outline: none;
209
+ }
210
+ .calendar-apple [data-slot="date-grid-cell"][data-weekend] {
211
+ color: rgb(138 138 141);
212
+ }
213
+ .calendar-apple [data-slot="date-grid-cell"][data-outside-month] {
214
+ color: rgb(60 60 67 / 0.3);
215
+ }
216
+ .calendar-apple [data-slot="date-grid-cell"][data-today] {
217
+ color: var(--calendar-today);
218
+ }
219
+ .calendar-apple [data-slot="date-grid-cell"][data-selected] {
220
+ font-weight: 600;
221
+ color: white;
222
+ background: CanvasText;
223
+ }
224
+ .calendar-apple [data-slot="date-grid-cell"][data-selected][data-today] {
225
+ background: var(--calendar-today);
226
+ }
227
+ .calendar-apple [data-slot="date-grid-cell"][data-focus-visible] {
228
+ outline: 2px solid Highlight;
229
+ outline-offset: 2px;
230
+ }
231
+ /*
232
+ * The days shown under the strip, when there are several: a 37pt pill
233
+ * behind them, from the first's disc to the last's. Mark each such day
234
+ * `data-range="start"`, `"middle"` or `"end"`.
235
+ */
236
+ .calendar-apple [data-slot="date-grid-cell-wrapper"]:has([data-range]) {
237
+ position: relative;
238
+ }
239
+ .calendar-apple [data-slot="date-grid-cell-wrapper"]:has([data-range])::before {
240
+ content: "";
241
+ position: absolute;
242
+ top: 1.67px;
243
+ height: 37px;
244
+ inset-inline: 0;
245
+ background: #eeeeef;
246
+ }
247
+ .calendar-apple [data-slot="date-grid-cell-wrapper"]:has([data-range="start"])::before {
248
+ inset-inline-start: calc(50% - 18.5px);
249
+ border-start-start-radius: 18.5px;
250
+ border-end-start-radius: 18.5px;
251
+ }
252
+ .calendar-apple [data-slot="date-grid-cell-wrapper"]:has([data-range="end"])::before {
253
+ inset-inline-end: calc(50% - 18.5px);
254
+ border-start-end-radius: 18.5px;
255
+ border-end-end-radius: 18.5px;
256
+ }
257
+ .calendar-apple [data-slot="date-grid-cell"][data-range] {
258
+ position: relative;
259
+ }
260
+
261
+ /*
262
+ * The list: a day's name over a rule, then its events, each with a bar of
263
+ * its colour, its name, and its start over its end at the far side. Today's
264
+ * heading is red; days gone by are grey.
265
+ */
266
+ .calendar-apple[data-slot="agenda"] {
267
+ padding: 0 12px 24px;
268
+ outline: none;
269
+ }
270
+ .calendar-apple [data-slot="agenda-day-header"] {
271
+ margin-top: 40px;
272
+ padding: 0 3.67px 8.33px;
273
+ border-bottom: 1px solid var(--calendar-line);
274
+ font-size: 16px;
275
+ line-height: 20px;
276
+ font-weight: 600;
277
+ color: CanvasText;
278
+ }
279
+ .calendar-apple [data-slot="agenda-day-header"][data-past] {
280
+ color: rgb(60 60 67 / 0.6);
281
+ }
282
+ .calendar-apple [data-slot="agenda-day-header"][data-today] {
283
+ color: var(--calendar-today);
284
+ }
285
+ .calendar-apple [data-slot="agenda-event"] {
286
+ position: relative;
287
+ /* React Aria puts an item's children in one grid cell that takes no box of its own (display: contents), so they are laid out here. */
288
+ display: flex;
289
+ align-items: flex-start;
290
+ gap: 8px;
291
+ min-height: 44px;
292
+ margin-top: 9.33px;
293
+ padding: 0 8.33px 0 18px;
294
+ border-radius: 8px;
295
+ font-size: 17px;
296
+ line-height: 22px;
297
+ font-weight: 600;
298
+ outline: none;
299
+ cursor: default;
300
+ }
301
+ .calendar-apple [data-slot="agenda-event"]::before {
302
+ content: "";
303
+ position: absolute;
304
+ top: 2px;
305
+ height: 39.33px;
306
+ inset-inline-start: 8px;
307
+ width: 3.5px;
308
+ border-radius: 1.75px;
309
+ background: var(--calendar-color);
310
+ }
311
+ .calendar-apple [data-slot="agenda-event"][data-all-day] {
312
+ align-items: center;
313
+ padding-inline-start: 5px;
314
+ }
315
+ .calendar-apple [data-slot="agenda-event"][data-all-day]::before {
316
+ display: none;
317
+ }
318
+ .calendar-apple [data-slot="agenda-event"] > [role="gridcell"] > :first-child {
319
+ flex: 1;
320
+ min-width: 0;
321
+ padding-top: 0.67px;
322
+ overflow: hidden;
323
+ white-space: nowrap;
324
+ text-overflow: ellipsis;
325
+ }
326
+ .calendar-apple [data-slot="agenda-event"] > [role="gridcell"] > :last-child:not(:first-child) {
327
+ display: grid;
328
+ grid-auto-rows: 19.33px;
329
+ justify-items: end;
330
+ padding-top: 3.33px;
331
+ font-size: 15px;
332
+ font-weight: 400;
333
+ line-height: 19.33px;
334
+ font-variant-numeric: tabular-nums;
335
+ }
336
+ /* The day period is small capitals, set against the digits: "7:00AM". */
337
+ .calendar-apple [data-slot="agenda-event"] .calendar-period {
338
+ font-size: 12px;
339
+ line-height: 1;
340
+ font-weight: 500;
341
+ letter-spacing: 0.01em;
342
+ }
343
+ .calendar-apple [data-slot="agenda-event"] > [role="gridcell"] > :last-child:not(:first-child) > :nth-child(2) {
344
+ color: rgb(60 60 67 / 0.55);
345
+ }
346
+ .calendar-apple [data-slot="agenda-day"][data-past] [data-slot="agenda-event"] {
347
+ color: rgb(60 60 67 / 0.75);
348
+ }
349
+ .calendar-apple [data-slot="agenda-event"][data-selected] {
350
+ background: rgb(60 60 67 / 0.08);
351
+ }
352
+ .calendar-apple [data-slot="agenda-event"][data-focus-visible] {
353
+ outline: 2px solid Highlight;
354
+ outline-offset: 2px;
355
+ }
356
+
357
+ /*
358
+ * A month: add `calendar-month`. Put the date in `.calendar-date` and what
359
+ * the day holds after it; which of the three layouts it is follows from
360
+ * what you put there. Measured from iOS (440pt wide):
361
+ *
362
+ * every layout a 2pt rule under the weekdays and a 1pt rule over each day
363
+ * of the month (so a month is ruled from its first day on);
364
+ * the date in a 39.33pt disc 7.33pt under the rule; the next
365
+ * month's name 20pt semibold over its first day
366
+ * (a week's height is `--calendar-week`; the rule is its
367
+ * first point, drawn as a shadow so it takes no room)
368
+ * compact `.calendar-dot`: a 5.67pt dot centred 57pt under the rule;
369
+ * a week is 69pt
370
+ * stacked `.calendar-bar`: 6pt bars, 2pt in from the day's edges,
371
+ * the first 54pt under the rule and 3pt between; a week is
372
+ * 89pt. Add `calendar-month-stacked`.
373
+ * details in the cell's `details`: `.calendar-chip` for an all-day event (16pt, round ends)
374
+ * and `.calendar-timed` for a timed one (43pt, its name over
375
+ * its time), 3pt between; a week is 328pt. Add
376
+ * `calendar-month-details`.
377
+ */
378
+ .calendar-apple.calendar-month {
379
+ --calendar-week: 69px;
380
+ --calendar-line: #e7e7e8;
381
+ padding: 0;
382
+ border-bottom: 0;
383
+ }
384
+ .calendar-apple.calendar-month-stacked {
385
+ --calendar-week: 89px;
386
+ }
387
+ .calendar-apple.calendar-month-details {
388
+ --calendar-week: 328px;
389
+ }
390
+ /* Borders kept apart, so a week is as tall as it is told to be. */
391
+ .calendar-apple.calendar-month [data-slot="date-grid-grid"] {
392
+ border-collapse: separate;
393
+ border-spacing: 0;
394
+ }
395
+ .calendar-apple.calendar-month [data-slot="date-grid-header"] {
396
+ border-bottom: 0;
397
+ }
398
+ .calendar-apple.calendar-month [data-slot="date-grid-header-cell"] {
399
+ border-bottom: 1px solid #dedede;
400
+ }
401
+ /* Under the weekdays the first week's rule is the other half of their 2pt rule. */
402
+ .calendar-apple.calendar-month [data-slot="date-grid-header"] + [data-slot="date-grid-body"] > [data-slot="date-grid-week"]:first-child {
403
+ --calendar-line: #dedede;
404
+ }
405
+ .calendar-apple.calendar-month [data-slot="date-grid-cell-wrapper"] {
406
+ height: var(--calendar-week);
407
+ vertical-align: top;
408
+ text-align: start;
409
+ }
410
+ /* A day's events, under it in its cell: the first 54pt under the rule, 3pt between. */
411
+ .calendar-apple.calendar-month [data-slot="date-grid-cell-details"] {
412
+ display: flex;
413
+ flex-direction: column;
414
+ gap: 3px;
415
+ min-width: 0;
416
+ margin-top: 7.33px;
417
+ }
418
+ .calendar-apple.calendar-month.calendar-month-details [data-slot="date-grid-cell"] {
419
+ min-height: 0;
420
+ }
421
+ .calendar-apple.calendar-month-details .calendar-date {
422
+ margin-bottom: 0;
423
+ }
424
+ .calendar-apple.calendar-month [data-slot="date-grid-cell-wrapper"]:not([data-outside-month], [data-empty]) {
425
+ box-shadow: inset 0 1px 0 var(--calendar-line);
426
+ }
427
+ .calendar-apple.calendar-month [data-slot="date-grid-cell"] {
428
+ display: flex;
429
+ flex-direction: column;
430
+ align-items: stretch;
431
+ gap: 3px;
432
+ width: 100%;
433
+ min-width: 0;
434
+ height: auto;
435
+ min-height: var(--calendar-week);
436
+ margin: 0;
437
+ padding-top: 8.33px;
438
+ box-sizing: border-box;
439
+ border-radius: 0;
440
+ font-size: 18.5px;
441
+ font-weight: 500;
442
+ text-align: start;
443
+ }
444
+ .calendar-apple.calendar-month [data-slot="date-grid-cell"][data-outside-month] {
445
+ visibility: hidden;
446
+ }
447
+ .calendar-apple.calendar-month [data-slot="date-grid-cell"][data-selected],
448
+ .calendar-apple.calendar-month [data-slot="date-grid-cell"][data-selected][data-today] {
449
+ color: inherit;
450
+ font-weight: inherit;
451
+ background: none;
452
+ }
453
+ .calendar-apple.calendar-month [data-slot="date-grid-cell"][data-weekend] {
454
+ color: rgb(138 138 141);
455
+ }
456
+ .calendar-apple.calendar-month [data-slot="date-grid-cell"][data-focus-visible] {
457
+ outline-offset: -2px;
458
+ }
459
+ .calendar-apple .calendar-date {
460
+ flex: none;
461
+ align-self: center;
462
+ display: grid;
463
+ place-items: center;
464
+ width: 39.33px;
465
+ height: 39.33px;
466
+ margin-bottom: 4.33px;
467
+ border-radius: 50%;
468
+ }
469
+ .calendar-apple [data-slot="date-grid-cell"][data-today] > .calendar-date {
470
+ font-weight: 600;
471
+ color: white;
472
+ background: var(--calendar-today);
473
+ }
474
+ .calendar-apple .calendar-dot {
475
+ flex: none;
476
+ align-self: center;
477
+ width: 5.67px;
478
+ height: 5.67px;
479
+ border-radius: 50%;
480
+ background: var(--calendar-color);
481
+ }
482
+ .calendar-apple .calendar-bar {
483
+ flex: none;
484
+ height: 6px;
485
+ margin-inline: 2px;
486
+ border-radius: 3px;
487
+ background: color-mix(in srgb, var(--calendar-color) 55%, white);
488
+ }
489
+ .calendar-apple .calendar-chip {
490
+ flex: none;
491
+ display: flex;
492
+ align-items: center;
493
+ height: 16px;
494
+ margin-inline: 2px;
495
+ padding-inline-start: 6px;
496
+ border-radius: 8px;
497
+ font-size: 12px;
498
+ line-height: 16px;
499
+ font-weight: 600;
500
+ white-space: nowrap;
501
+ overflow: hidden;
502
+ color: color-mix(in srgb, var(--calendar-color) 50%, black);
503
+ background: color-mix(in srgb, var(--calendar-color) 28%, white);
504
+ /* A name too long for the day fades out at the chip's far end. */
505
+ -webkit-mask-image: linear-gradient(to left, transparent 2px, black 14px);
506
+ mask-image: linear-gradient(to left, transparent 2px, black 14px);
507
+ }
508
+ .calendar-apple [dir="rtl"] .calendar-chip,
509
+ .calendar-apple[dir="rtl"] .calendar-chip {
510
+ -webkit-mask-image: linear-gradient(to right, transparent 2px, black 14px);
511
+ mask-image: linear-gradient(to right, transparent 2px, black 14px);
512
+ }
513
+ /* A calendar's mark at the head of a chip: a 10.67pt disc 2pt in, the name 18pt in. */
514
+ .calendar-apple .calendar-chip-icon {
515
+ flex: none;
516
+ width: 10.67px;
517
+ height: 10.67px;
518
+ margin-inline: -4px 5.33px;
519
+ border-radius: 50%;
520
+ /* A star, as a calendar of holidays has; put a mark of your own inside to replace it (`data-icon="none"` for a plain disc). */
521
+ background:
522
+ var(--calendar-color) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M12 2.6l2.8 6 6.6.8-4.9 4.5 1.3 6.5L12 17.2l-5.8 3.2 1.3-6.5L2.6 9.4l6.6-.8z'/%3E%3C/svg%3E") center /
523
+ 7.33px no-repeat;
524
+ }
525
+ .calendar-apple .calendar-chip-icon[data-icon="none"],
526
+ .calendar-apple .calendar-chip-icon:not(:empty) {
527
+ background-image: none;
528
+ }
529
+ .calendar-apple .calendar-timed {
530
+ flex: none;
531
+ display: flex;
532
+ flex-direction: column;
533
+ justify-content: space-between;
534
+ height: var(--calendar-timed-height, 43px);
535
+ margin-inline: 2px;
536
+ padding: 1.33px 2px 2px;
537
+ box-sizing: border-box;
538
+ border-radius: 4.5px;
539
+ font-size: 11px;
540
+ line-height: 13px;
541
+ font-weight: 600;
542
+ overflow: hidden;
543
+ color: color-mix(in srgb, var(--calendar-color) 50%, black);
544
+ background: color-mix(in srgb, var(--calendar-color) 30%, white);
545
+ }
546
+ .calendar-apple .calendar-timed > :last-child:not(:first-child) {
547
+ font-weight: 400;
548
+ letter-spacing: -0.4px;
549
+ color: color-mix(in srgb, var(--calendar-color) 75%, black);
550
+ }
551
+ /* The month's name over its first day, on the row above it. */
552
+ .calendar-apple.calendar-month [data-slot="date-grid-heading"] {
553
+ display: flex;
554
+ align-items: flex-end;
555
+ height: 25.67px;
556
+ margin: 0;
557
+ padding-bottom: 2.67px;
558
+ box-sizing: border-box;
559
+ margin-inline-start: calc(var(--date-grid-start-column) * 100% / 7 + 13.67px);
560
+ font-size: 20px;
561
+ line-height: 24px;
562
+ font-weight: 600;
563
+ }
564
+
565
+ /*
566
+ * Round a view, as iOS Calendar has it (measured from an iPhone, 440pt
567
+ * wide): these are plain elements of yours, dressed by class.
568
+ *
569
+ * .calendar-nav the row over a view: 20pt in from each side (16pt on a phone under 430pt wide)
570
+ * .calendar-pill a 44pt glass capsule that floats over what scrolls under it; its
571
+ * buttons are 44pt targets, their words 17pt
572
+ * .calendar-large-title what is shown, 32pt bold, 22pt in
573
+ * .calendar-floating a pill held 28pt over the foot of the screen ("Today" is 48pt tall)
574
+ */
575
+ .calendar-apple .calendar-nav,
576
+ .calendar-apple.calendar-nav {
577
+ display: flex;
578
+ align-items: center;
579
+ justify-content: space-between;
580
+ padding: 0 20px;
581
+ }
582
+ /* The system's margin is 16pt on a phone under 430pt wide, and 20pt from there. */
583
+ @media (width < 430px) {
584
+ .calendar-apple .calendar-nav,
585
+ .calendar-apple.calendar-nav {
586
+ padding: 0 16px;
587
+ }
588
+ }
589
+ /* A week's strip under the row: its letters start 14pt under the pills. */
590
+ .calendar-apple .calendar-nav + [data-slot="date-grid"] {
591
+ margin-top: 14px;
592
+ }
593
+ .calendar-apple .calendar-pill,
594
+ .calendar-apple.calendar-pill {
595
+ display: inline-flex;
596
+ align-items: center;
597
+ height: 44px;
598
+ padding: 0;
599
+ border: 0.33px solid rgb(0 0 0 / 0.14);
600
+ border-radius: 22px;
601
+ font-size: 17px;
602
+ line-height: 22px;
603
+ color: CanvasText;
604
+ background: rgb(255 255 255 / 0.72);
605
+ -webkit-backdrop-filter: blur(20px) saturate(1.8);
606
+ backdrop-filter: blur(20px) saturate(1.8);
607
+ box-shadow: 0 2px 12px rgb(0 0 0 / 0.06);
608
+ }
609
+ .calendar-apple .calendar-pill > button,
610
+ .calendar-apple button.calendar-pill {
611
+ display: inline-flex;
612
+ align-items: center;
613
+ justify-content: center;
614
+ gap: 6px;
615
+ /* Icons sit 35pt apart, and 14pt in from the capsule's ends. */
616
+ height: 44px;
617
+ padding: 0 17.5px;
618
+ border: 0;
619
+ border-radius: 22px;
620
+ font: inherit;
621
+ color: inherit;
622
+ background: none;
623
+ cursor: default;
624
+ }
625
+ .calendar-apple button.calendar-pill {
626
+ padding: 0 16px 0 10px;
627
+ border: 0.33px solid rgb(0 0 0 / 0.14);
628
+ /* Said again here: `font: inherit` above would have a button's words the calendar's 15pt. */
629
+ font-size: 17px;
630
+ line-height: 22px;
631
+ font-weight: 500;
632
+ background: rgb(255 255 255 / 0.72);
633
+ }
634
+ .calendar-apple .calendar-pill > button:focus-visible,
635
+ .calendar-apple button.calendar-pill:focus-visible {
636
+ outline: 2px solid Highlight;
637
+ outline-offset: -2px;
638
+ }
639
+ .calendar-apple .calendar-pill > button:first-child {
640
+ padding-inline-start: 14px;
641
+ }
642
+ .calendar-apple .calendar-pill > button:last-child {
643
+ padding-inline-end: 14px;
644
+ }
645
+ /* An icon is its glyph, at the size you give it (SF Symbols: a chevron 18.7pt, search 21pt, add 17.7pt). */
646
+ .calendar-apple .calendar-pill svg {
647
+ flex: none;
648
+ fill: currentColor;
649
+ }
650
+ /* A chevron before words: 12pt between what is seen of them. */
651
+ .calendar-apple .calendar-pill svg[data-mirror] {
652
+ margin-inline-end: -1px;
653
+ }
654
+ .calendar-apple[dir="rtl"] .calendar-pill svg[data-mirror],
655
+ .calendar-apple [dir="rtl"] .calendar-pill svg[data-mirror] {
656
+ transform: scaleX(-1);
657
+ }
658
+ .calendar-apple .calendar-large-title,
659
+ .calendar-apple.calendar-large-title {
660
+ margin: 0;
661
+ padding: 18px 22px 12px;
662
+ font-size: 32px;
663
+ line-height: 38px;
664
+ font-weight: 700;
665
+ letter-spacing: -0.01em;
666
+ }
667
+ /* The day in words between its week and its hours: 15pt semibold, centred in 36pt, over a hairline. */
668
+ .calendar-apple .calendar-day-title {
669
+ display: grid;
670
+ place-items: center;
671
+ height: 36px;
672
+ margin: 0;
673
+ border-bottom: 0.67px solid #e8e8e8;
674
+ font-size: 15px;
675
+ font-weight: 600;
676
+ }
677
+ .calendar-apple .calendar-pill.calendar-floating,
678
+ .calendar-apple.calendar-pill.calendar-floating {
679
+ position: fixed;
680
+ /* Over everything in the view, the hours that stay put on a phone included. */
681
+ z-index: 10;
682
+ bottom: 28px;
683
+ inset-inline-start: 28px;
684
+ height: 48px;
685
+ padding: 0 17px;
686
+ border-radius: 24px;
687
+ font-weight: 500;
688
+ }
689
+ .calendar-apple .calendar-floating[data-side="end"],
690
+ .calendar-apple.calendar-floating[data-side="end"] {
691
+ inset-inline: auto 28px;
692
+ }
693
+
694
+ /*
695
+ * An event's own screen, as iOS Calendar has it (measured from an iPhone,
696
+ * 440pt wide): plain elements of yours, dressed by class.
697
+ *
698
+ * .calendar-detail the screen: #f2f2f6, its cards 20pt in from each side
699
+ * .calendar-detail-title the event's name, 22pt bold, 21pt in from a card's edge
700
+ * .calendar-detail-text its lines, 17pt on a 21.33pt pitch; `.calendar-muted` ones are #85858a
701
+ * .calendar-card a white card with 26pt corners, 21.67pt under what is before it: put a
702
+ * time grid in one for the event against its hours
703
+ * .calendar-row a 51pt white capsule: a label, and its value at the far side in grey
704
+ * .calendar-pill[data-tone="destructive"] red words, as "Delete Event"
705
+ */
706
+ .calendar-apple.calendar-detail {
707
+ min-height: 100dvh;
708
+ padding: 0 20px 96px;
709
+ font-size: 17px;
710
+ line-height: 21.33px;
711
+ background: #f2f2f6;
712
+ }
713
+ .calendar-apple.calendar-detail .calendar-nav {
714
+ padding: 12px 0 0;
715
+ }
716
+ .calendar-apple .calendar-detail-title {
717
+ margin: 0;
718
+ padding: 19px 21px 0;
719
+ font-size: 22px;
720
+ line-height: 28px;
721
+ font-weight: 700;
722
+ }
723
+ .calendar-apple .calendar-detail-text {
724
+ margin: 0;
725
+ padding: 6px 21px 0;
726
+ }
727
+ .calendar-apple .calendar-detail-text + .calendar-detail-text {
728
+ padding-top: 14px;
729
+ }
730
+ .calendar-apple .calendar-detail-text a {
731
+ color: inherit;
732
+ text-decoration: underline;
733
+ text-decoration-color: rgb(60 60 67 / 0.3);
734
+ text-underline-offset: 3px;
735
+ }
736
+ .calendar-apple .calendar-muted {
737
+ color: #85858a;
738
+ }
739
+ .calendar-apple .calendar-card {
740
+ margin-top: 21.67px;
741
+ overflow: hidden;
742
+ border-radius: 26px;
743
+ background: white;
744
+ }
745
+ .calendar-apple .calendar-card > .calendar {
746
+ background: none;
747
+ }
748
+ .calendar-apple .calendar-row {
749
+ display: flex;
750
+ align-items: center;
751
+ justify-content: space-between;
752
+ gap: 12px;
753
+ min-height: 51px;
754
+ margin-top: 21.67px;
755
+ padding: 0 20.67px;
756
+ border-radius: 25.5px;
757
+ background: white;
758
+ }
759
+ .calendar-apple .calendar-row > :last-child:not(:first-child) {
760
+ display: inline-flex;
761
+ align-items: center;
762
+ gap: 11px;
763
+ color: #85858a;
764
+ }
765
+ .calendar-apple .calendar-row .calendar-dot {
766
+ width: 12.33px;
767
+ height: 12.33px;
768
+ }
769
+ .calendar-apple .calendar-pill[data-tone="destructive"] {
770
+ color: #e94a46;
771
+ }
772
+ .calendar-apple .calendar-pill.calendar-floating[data-side="center"],
773
+ .calendar-apple.calendar-pill.calendar-floating[data-side="center"] {
774
+ inset-inline: 50% auto;
775
+ transform: translateX(-50%);
776
+ }
777
+ .calendar-apple[dir="rtl"] .calendar-pill.calendar-floating[data-side="center"],
778
+ .calendar-apple [dir="rtl"] .calendar-pill.calendar-floating[data-side="center"] {
779
+ transform: translateX(50%);
780
+ }
781
+
782
+ /*
783
+ * A screen, as an iPhone's: add `calendar-screen` to what holds the row over a view and the view. It is as
784
+ * tall as the screen, the row and whatever else comes first stay put, and the time grid or the list under
785
+ * them scrolls in what is left.
786
+ */
787
+ .calendar-apple.calendar-screen {
788
+ display: flex;
789
+ flex-direction: column;
790
+ box-sizing: border-box;
791
+ height: 100dvh;
792
+ }
793
+ .calendar-apple.calendar-screen > .calendar-week,
794
+ .calendar-apple.calendar-screen > [data-slot="agenda"] {
795
+ flex: 1;
796
+ min-height: 0;
797
+ overflow: auto;
798
+ scrollbar-width: none;
799
+ }
800
+ /* Days' names stay over their columns while the hours scroll under them. */
801
+ .calendar-apple.calendar-screen > .calendar-week > [data-slot="time-grid-day-header"],
802
+ .calendar-apple.calendar-screen > .calendar-week > .calendar-corner {
803
+ position: sticky;
804
+ top: 0;
805
+ z-index: 3;
806
+ background: var(--calendar-surface);
807
+ }
808
+ .calendar-apple.calendar-screen > .calendar-week > .calendar-corner {
809
+ z-index: 5;
810
+ }
811
+ /*
812
+ * Days that page: add `calendar-paged`, and say how many fill the view with `--calendar-days-shown` (1 or 2).
813
+ * Give the grid `scrollSnap="days"` and a swipe moves on by a day and comes to rest on one.
814
+ */
815
+ .calendar-apple.calendar-week.calendar-paged {
816
+ --calendar-column: calc((100vw - var(--calendar-gutter)) / var(--calendar-days-shown, 1));
817
+ }