starlight-theme-apple 0.6.0 → 0.9.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.
Files changed (43) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +47 -5
  3. package/components/Footer.astro +19 -0
  4. package/components/Header.astro +55 -0
  5. package/components/NavLink.astro +24 -0
  6. package/components/PageFrame.astro +11 -0
  7. package/components/PageTitle.astro +24 -40
  8. package/components/Pagination.astro +22 -29
  9. package/components/Sidebar.astro +27 -0
  10. package/components/SiteFooter.astro +61 -0
  11. package/components/SocialIcons.astro +22 -0
  12. package/components.ts +10 -0
  13. package/index.ts +81 -120
  14. package/libs/breadcrumbs.ts +80 -0
  15. package/libs/config.ts +54 -0
  16. package/libs/expressive-code.ts +246 -0
  17. package/libs/links.ts +38 -0
  18. package/package.json +11 -5
  19. package/styles/base.css +35 -53
  20. package/styles/code.css +7 -83
  21. package/styles/components.css +599 -0
  22. package/styles/content.css +224 -414
  23. package/styles/header.css +217 -62
  24. package/styles/reference.css +332 -0
  25. package/styles/search.css +87 -73
  26. package/styles/sidebar.css +77 -56
  27. package/styles/toc.css +55 -40
  28. package/styles/tokens.css +134 -93
  29. package/styles.css +4 -4
  30. package/translations.ts +31 -0
  31. package/user-components/Availability.astro +21 -0
  32. package/user-components/Declaration.astro +16 -0
  33. package/user-components/Figure.astro +58 -0
  34. package/user-components/Parameter.astro +14 -0
  35. package/user-components/ParameterList.astro +11 -0
  36. package/user-components/ReferenceEntry.astro +12 -0
  37. package/user-components/ReferenceMeta.astro +30 -0
  38. package/user-components/TopicLink.astro +17 -0
  39. package/user-components/TopicList.astro +5 -0
  40. package/user-components/ValueList.astro +20 -0
  41. package/virtual.d.ts +10 -0
  42. package/styles/controls.css +0 -190
  43. package/styles/responsive.css +0 -148
@@ -0,0 +1,599 @@
1
+ /* ============================================================
2
+ Asides: tinted panels with a colored label, like Apple’s Note, Tip, Important, Warning.
3
+ ============================================================ */
4
+
5
+ .starlight-aside {
6
+ --apple-aside-accent: var(--apple-note);
7
+ padding: 0.9375rem 1.125rem;
8
+ border: 1px solid
9
+ color-mix(in srgb, var(--apple-aside-accent) 32%, transparent);
10
+ border-radius: var(--apple-radius-panel);
11
+ background: color-mix(
12
+ in srgb,
13
+ var(--apple-aside-accent) 7%,
14
+ var(--apple-background)
15
+ );
16
+ color: var(--apple-foreground);
17
+ font-size: 0.9375rem;
18
+ line-height: 1.4667;
19
+ letter-spacing: -0.016em;
20
+ }
21
+ .starlight-aside--note {
22
+ --apple-aside-accent: var(--apple-note);
23
+ background: var(--apple-secondary-background);
24
+ border-color: var(--apple-hairline);
25
+ }
26
+ .starlight-aside--tip {
27
+ --apple-aside-accent: var(--apple-tip);
28
+ }
29
+ .starlight-aside--caution {
30
+ --apple-aside-accent: var(--apple-caution);
31
+ }
32
+ .starlight-aside--danger {
33
+ --apple-aside-accent: var(--apple-danger);
34
+ }
35
+ .starlight-aside__icon {
36
+ display: none;
37
+ }
38
+ .starlight-aside__title {
39
+ color: var(--apple-aside-accent);
40
+ font-size: inherit;
41
+ font-weight: 600;
42
+ line-height: inherit;
43
+ letter-spacing: inherit;
44
+ }
45
+ .starlight-aside--note .starlight-aside__title {
46
+ color: var(--apple-foreground);
47
+ }
48
+ .starlight-aside__title + .starlight-aside__content {
49
+ margin-top: 0.25rem;
50
+ }
51
+ .sl-markdown-content .starlight-aside__content :is(p, ul, ol) {
52
+ margin-block: 0.5rem 0;
53
+ }
54
+ .sl-markdown-content .starlight-aside__content > :first-child {
55
+ margin-top: 0;
56
+ }
57
+ .starlight-aside__content a {
58
+ color: var(--apple-link);
59
+ }
60
+ .sl-markdown-content .starlight-aside code {
61
+ background: none;
62
+ }
63
+
64
+ /* ============================================================
65
+ Cards: soft tiles for feature discovery
66
+ ============================================================ */
67
+
68
+ .card-grid {
69
+ gap: 1rem;
70
+ }
71
+ .card-grid.stagger {
72
+ --stagger-height: 2rem;
73
+ }
74
+ .sl-markdown-content .card {
75
+ gap: 0.5rem;
76
+ padding: 1.5rem 1.5rem 1.625rem;
77
+ border: 0;
78
+ border-radius: var(--apple-radius-card);
79
+ background: var(--apple-secondary-background);
80
+ box-shadow: none;
81
+ }
82
+ .sl-markdown-content .card .title {
83
+ flex-direction: column;
84
+ align-items: flex-start;
85
+ gap: 0.75rem;
86
+ color: var(--apple-foreground);
87
+ font-size: 1.1875rem;
88
+ font-weight: 600;
89
+ line-height: 1.25;
90
+ letter-spacing: 0.012em;
91
+ }
92
+ .sl-markdown-content .card .icon {
93
+ width: 1.75rem;
94
+ height: 1.75rem;
95
+ margin: 0;
96
+ padding: 0;
97
+ border: 0;
98
+ background: none;
99
+ color: var(--apple-link);
100
+ }
101
+ .sl-markdown-content .card .body {
102
+ color: var(--apple-secondary-foreground);
103
+ font-size: 0.9375rem;
104
+ line-height: 1.4667;
105
+ letter-spacing: -0.016em;
106
+ }
107
+ .sl-markdown-content .card .body > :first-child {
108
+ margin-top: 0;
109
+ }
110
+
111
+ /* Link cards: hairline rows that read like Apple topic links. */
112
+ .sl-markdown-content .sl-link-card {
113
+ align-items: center;
114
+ gap: 0.5rem 1rem;
115
+ padding: 1.125rem 1.25rem;
116
+ border: 1px solid var(--apple-hairline);
117
+ border-radius: var(--apple-radius-panel);
118
+ background: var(--apple-background);
119
+ box-shadow: none;
120
+ }
121
+ .sl-markdown-content .sl-link-card:hover {
122
+ border-color: var(--apple-hairline);
123
+ background: var(--apple-fill-secondary);
124
+ }
125
+ .sl-markdown-content .sl-link-card .stack {
126
+ gap: 0.25rem;
127
+ }
128
+ .sl-markdown-content .sl-link-card a {
129
+ color: var(--apple-link);
130
+ text-decoration: none;
131
+ }
132
+ .sl-markdown-content .sl-link-card .title {
133
+ font-size: 1.0625rem;
134
+ font-weight: 600;
135
+ line-height: 1.375rem;
136
+ letter-spacing: -0.022em;
137
+ }
138
+ .sl-markdown-content .sl-link-card .description {
139
+ color: var(--apple-secondary-foreground);
140
+ font-size: 0.9375rem;
141
+ line-height: 1.4667;
142
+ letter-spacing: -0.016em;
143
+ }
144
+ .sl-markdown-content .sl-link-card .icon {
145
+ width: 1rem;
146
+ height: 1rem;
147
+ color: var(--apple-tertiary-foreground);
148
+ transition: transform var(--apple-transition);
149
+ }
150
+ .sl-markdown-content .sl-link-card:hover .icon {
151
+ color: var(--apple-link);
152
+ transform: translateX(2px);
153
+ }
154
+ .sl-markdown-content .sl-link-card:focus-within {
155
+ outline: 2px solid var(--apple-link);
156
+ outline-offset: 2px;
157
+ }
158
+ .sl-markdown-content .sl-link-card a:focus-visible {
159
+ outline: 0;
160
+ }
161
+
162
+ /* ============================================================
163
+ Link buttons: Apple pill buttons
164
+ ============================================================ */
165
+
166
+ .sl-link-button {
167
+ gap: 0.375rem;
168
+ min-height: 2.75rem;
169
+ padding: 0.6875rem 1.375rem;
170
+ border: 0;
171
+ border-radius: 980px;
172
+ font-size: 1.0625rem;
173
+ font-weight: 400;
174
+ line-height: 1.375rem;
175
+ letter-spacing: -0.022em;
176
+ text-decoration: none;
177
+ }
178
+ .sl-link-button svg {
179
+ width: 1rem;
180
+ height: 1rem;
181
+ }
182
+ .sl-link-button.primary {
183
+ border: 0;
184
+ background: var(--apple-button-background);
185
+ color: var(--apple-button-foreground);
186
+ }
187
+ .sl-link-button.primary:hover {
188
+ background: var(--apple-button-background-hover);
189
+ color: var(--apple-button-foreground);
190
+ }
191
+ .sl-link-button.secondary {
192
+ border: 1px solid var(--apple-link);
193
+ background: transparent;
194
+ color: var(--apple-link);
195
+ }
196
+ .sl-link-button.secondary:hover {
197
+ background: var(--apple-link);
198
+ color: var(--apple-background);
199
+ }
200
+ .sl-link-button.minimal {
201
+ padding-inline: 0;
202
+ background: transparent;
203
+ color: var(--apple-link);
204
+ }
205
+ .sl-link-button.minimal:hover {
206
+ color: var(--apple-link);
207
+ text-decoration: underline;
208
+ }
209
+ .sl-link-button:focus-visible {
210
+ outline: 0;
211
+ box-shadow:
212
+ 0 0 0 3px var(--apple-background),
213
+ 0 0 0 5px var(--apple-link);
214
+ }
215
+ .sl-markdown-content .sl-link-button {
216
+ margin-inline-end: 0.75rem;
217
+ }
218
+
219
+ /* ============================================================
220
+ Tabs: a segmented-style underline bar
221
+ ============================================================ */
222
+
223
+ starlight-tabs .tablist-wrapper {
224
+ margin-bottom: 1rem;
225
+ }
226
+ starlight-tabs [role="tablist"] {
227
+ gap: 1.5rem;
228
+ border-bottom: 1px solid var(--apple-hairline);
229
+ }
230
+ starlight-tabs [role="tab"] {
231
+ margin-bottom: -1px;
232
+ padding: 0.5rem 0;
233
+ border: 0;
234
+ border-bottom: 2px solid transparent;
235
+ color: var(--apple-secondary-foreground);
236
+ font-size: 0.9375rem;
237
+ font-weight: 400;
238
+ line-height: 1.375rem;
239
+ letter-spacing: -0.016em;
240
+ text-decoration: none;
241
+ }
242
+ starlight-tabs [role="tab"]:hover {
243
+ color: var(--apple-foreground);
244
+ }
245
+ starlight-tabs [role="tab"][aria-selected="true"] {
246
+ border-bottom-color: var(--apple-foreground);
247
+ color: var(--apple-foreground);
248
+ font-weight: 600;
249
+ }
250
+ starlight-tabs [role="tab"]:focus-visible {
251
+ outline-offset: -2px;
252
+ }
253
+
254
+ /* ============================================================
255
+ Steps
256
+ ============================================================ */
257
+
258
+ .sl-steps {
259
+ --bullet-size: 1.75rem;
260
+ }
261
+ .sl-steps > li {
262
+ padding-inline-start: 2.75rem;
263
+ padding-bottom: 0.5rem;
264
+ }
265
+ .sl-steps > li::before {
266
+ background: var(--apple-foreground);
267
+ color: var(--apple-background);
268
+ box-shadow: none;
269
+ font-size: 0.8125rem;
270
+ letter-spacing: 0;
271
+ }
272
+ .sl-steps > li::after {
273
+ background: var(--apple-hairline);
274
+ }
275
+
276
+ /* ============================================================
277
+ Badges: quiet capsules
278
+ ============================================================ */
279
+
280
+ .sl-badge {
281
+ --apple-badge-color: var(--apple-link);
282
+ display: inline-block;
283
+ padding: 0.0625rem 0.5rem;
284
+ border: 0;
285
+ border-radius: 980px;
286
+ background: color-mix(in srgb, var(--apple-badge-color) 13%, transparent);
287
+ color: var(--apple-badge-color);
288
+ font-family: var(--apple-font-sans);
289
+ font-size: 0.75rem;
290
+ font-weight: 600;
291
+ line-height: 1.125rem;
292
+ letter-spacing: 0;
293
+ vertical-align: middle;
294
+ }
295
+ .sl-badge.note {
296
+ --apple-badge-color: var(--apple-link);
297
+ }
298
+ .sl-badge.tip,
299
+ .sl-badge.success {
300
+ --apple-badge-color: var(--apple-success);
301
+ }
302
+ .sl-badge.caution {
303
+ --apple-badge-color: var(--apple-caution);
304
+ }
305
+ .sl-badge.danger {
306
+ --apple-badge-color: var(--apple-danger);
307
+ }
308
+ .sl-badge.large {
309
+ padding-inline: 0.625rem;
310
+ font-size: 0.875rem;
311
+ line-height: 1.5rem;
312
+ }
313
+ .sidebar-content .sl-badge {
314
+ padding: 0 0.4375rem;
315
+ font-size: 0.6875rem;
316
+ line-height: 1.125rem;
317
+ }
318
+ .sidebar-content a[aria-current="page"] > .sl-badge {
319
+ border: 0;
320
+ background: color-mix(in srgb, var(--apple-badge-color) 13%, transparent);
321
+ color: var(--apple-badge-color);
322
+ }
323
+
324
+ /* ============================================================
325
+ File tree
326
+ ============================================================ */
327
+
328
+ starlight-file-tree {
329
+ --x-space: 1.25rem;
330
+ padding: 1rem 1.25rem;
331
+ border: 0;
332
+ border-radius: var(--apple-radius-panel);
333
+ background: var(--apple-code-background);
334
+ font-size: 0.875rem;
335
+ }
336
+ starlight-file-tree .tree-icon,
337
+ starlight-file-tree .comment {
338
+ color: var(--apple-tertiary-foreground);
339
+ }
340
+ starlight-file-tree .highlight .tree-entry {
341
+ color: var(--apple-link);
342
+ }
343
+
344
+ /* ============================================================
345
+ Splash hero: a centered headline, pill actions, and media below
346
+ ============================================================ */
347
+
348
+ .hero {
349
+ grid-template-columns: 100%;
350
+ justify-items: center;
351
+ gap: clamp(2.5rem, 6vw, 4rem);
352
+ padding-block: clamp(2.5rem, 8vw, 5.5rem) clamp(2rem, 5vw, 3.5rem);
353
+ text-align: center;
354
+ }
355
+ .hero > :is(img, .hero-html) {
356
+ order: 2;
357
+ width: min(100%, 20rem);
358
+ margin-inline: auto;
359
+ }
360
+ .hero > .hero-html {
361
+ width: min(100%, 60rem);
362
+ }
363
+ .hero .stack {
364
+ align-items: center;
365
+ gap: 2rem;
366
+ text-align: center;
367
+ }
368
+ .hero .copy {
369
+ align-items: center;
370
+ gap: 1rem;
371
+ }
372
+ .hero .copy > * {
373
+ max-width: 40rem;
374
+ }
375
+ .hero h1 {
376
+ color: var(--apple-foreground);
377
+ font-size: clamp(2.5rem, 1.6rem + 4.5vw, 4.5rem);
378
+ font-weight: 600;
379
+ line-height: 1.05;
380
+ letter-spacing: -0.015em;
381
+ text-wrap: balance;
382
+ }
383
+ .hero .tagline {
384
+ color: var(--apple-secondary-foreground);
385
+ font-size: clamp(1.1875rem, 1rem + 0.9vw, 1.75rem);
386
+ font-weight: 400;
387
+ line-height: 1.25;
388
+ letter-spacing: 0.007em;
389
+ text-wrap: balance;
390
+ }
391
+ .hero .actions {
392
+ justify-content: center;
393
+ gap: 0.75rem 1rem;
394
+ }
395
+
396
+ /* Splash pages: centered section headings and introductions. */
397
+ :root[data-has-hero]
398
+ .sl-markdown-content
399
+ > :is(h2, .sl-heading-wrapper.level-h2) {
400
+ margin-top: clamp(3.5rem, 8vw, 5.5rem);
401
+ text-align: center;
402
+ }
403
+ :root[data-has-hero]
404
+ .sl-markdown-content
405
+ > :is(h2, .sl-heading-wrapper.level-h2)
406
+ + p {
407
+ max-width: 42rem;
408
+ margin-inline: auto;
409
+ color: var(--apple-secondary-foreground);
410
+ font-size: 1.1875rem;
411
+ line-height: 1.42;
412
+ text-align: center;
413
+ }
414
+ :root[data-has-hero] .sl-markdown-content > p:first-child {
415
+ font-size: clamp(1.1875rem, 1rem + 0.6vw, var(--apple-text-lead));
416
+ max-width: 42rem;
417
+ margin-inline: auto;
418
+ text-align: center;
419
+ }
420
+
421
+ @media (min-width: 50rem) {
422
+ .hero {
423
+ grid-template-columns: 100%;
424
+ }
425
+ .hero .stack,
426
+ .hero .copy {
427
+ align-items: center;
428
+ text-align: center;
429
+ }
430
+ .hero .actions {
431
+ justify-content: center;
432
+ }
433
+ }
434
+
435
+ /* ============================================================
436
+ Footer and pagination
437
+ ============================================================ */
438
+
439
+ .apple-footer {
440
+ display: flex;
441
+ flex-direction: column;
442
+ gap: 2.5rem;
443
+ margin-top: 4rem;
444
+ }
445
+
446
+ .apple-footer__meta {
447
+ display: flex;
448
+ flex-wrap: wrap;
449
+ justify-content: space-between;
450
+ gap: 0.5rem 2rem;
451
+ color: var(--apple-secondary-foreground);
452
+ font-size: 0.8125rem;
453
+ line-height: 1.125rem;
454
+ letter-spacing: -0.008em;
455
+ }
456
+ .apple-footer__meta > :only-child {
457
+ margin-inline-start: auto;
458
+ }
459
+ .apple-footer__meta a {
460
+ gap: 0.375rem;
461
+ color: var(--apple-link);
462
+ }
463
+ .apple-footer__meta a:hover {
464
+ color: var(--apple-link);
465
+ text-decoration: underline;
466
+ }
467
+
468
+ .apple-pagination {
469
+ display: grid;
470
+ grid-template-columns: repeat(2, minmax(0, 1fr));
471
+ gap: 1rem;
472
+ padding-top: 1.5rem;
473
+ border-top: 1px solid var(--apple-hairline);
474
+ }
475
+ .apple-pagination a {
476
+ display: flex;
477
+ flex-direction: column;
478
+ gap: 0.125rem;
479
+ min-width: 0;
480
+ text-decoration: none;
481
+ }
482
+ .apple-pagination a[rel="next"] {
483
+ grid-column: 2;
484
+ align-items: flex-end;
485
+ text-align: end;
486
+ }
487
+ .apple-pagination__label {
488
+ color: var(--apple-secondary-foreground);
489
+ font-size: 0.8125rem;
490
+ line-height: 1.125rem;
491
+ letter-spacing: -0.008em;
492
+ }
493
+ .apple-pagination__title {
494
+ color: var(--apple-link);
495
+ font-size: 1.0625rem;
496
+ line-height: 1.375rem;
497
+ overflow-wrap: break-word;
498
+ }
499
+ .apple-pagination a:hover .apple-pagination__title {
500
+ text-decoration: underline;
501
+ }
502
+
503
+ /* Site navigation lives outside the article columns, across the whole page. */
504
+ .apple-site-footer {
505
+ position: relative;
506
+ border-top: 1px solid var(--apple-hairline);
507
+ background: var(--apple-secondary-background);
508
+ color: var(--apple-secondary-foreground);
509
+ font-size: 0.8125rem;
510
+ line-height: 1.5;
511
+ letter-spacing: -0.008em;
512
+ }
513
+ .apple-site-footer__inner {
514
+ width: min(100%, 67.5rem);
515
+ margin-inline: auto;
516
+ padding: 1.75rem 1.5rem 1rem;
517
+ }
518
+ .apple-site-footer a {
519
+ display: inline-flex;
520
+ align-items: center;
521
+ gap: 0.375rem;
522
+ color: inherit;
523
+ text-decoration: none;
524
+ }
525
+ .apple-site-footer a:hover {
526
+ color: var(--apple-foreground);
527
+ text-decoration: underline;
528
+ }
529
+ .apple-site-footer__directory {
530
+ display: grid;
531
+ grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
532
+ gap: 1.5rem 3rem;
533
+ padding-bottom: 1.5rem;
534
+ }
535
+ .apple-site-footer__group h2 {
536
+ margin: 0 0 0.625rem;
537
+ color: var(--apple-foreground);
538
+ font-size: inherit;
539
+ font-weight: 600;
540
+ line-height: inherit;
541
+ }
542
+ .apple-site-footer ul {
543
+ margin: 0;
544
+ padding: 0;
545
+ list-style: none;
546
+ }
547
+ .apple-site-footer__group li + li {
548
+ margin-top: 0.5rem;
549
+ }
550
+ .apple-site-footer__bottom {
551
+ display: flex;
552
+ flex-wrap: wrap;
553
+ align-items: center;
554
+ gap: 0.75rem 1.5rem;
555
+ padding-top: 1rem;
556
+ border-top: 1px solid var(--apple-hairline);
557
+ font-size: 0.75rem;
558
+ }
559
+ .apple-site-footer__bottom p {
560
+ margin: 0;
561
+ margin-inline-end: auto;
562
+ }
563
+ .apple-site-footer__bottom ul {
564
+ display: flex;
565
+ flex-wrap: wrap;
566
+ gap: 0.75rem 1.5rem;
567
+ }
568
+ .apple-site-footer svg {
569
+ width: 0.875rem;
570
+ height: 0.875rem;
571
+ }
572
+ @media (min-width: 50rem) {
573
+ .apple-site-footer {
574
+ /* Cover the fixed navigator only as the footer enters the viewport. */
575
+ z-index: calc(var(--sl-z-index-menu) + 1);
576
+ }
577
+ }
578
+ @media print {
579
+ .apple-site-footer {
580
+ display: none;
581
+ }
582
+ }
583
+
584
+ @media (max-width: 49.99rem) {
585
+ .apple-pagination {
586
+ grid-template-columns: 1fr;
587
+ }
588
+ .apple-pagination a[rel="next"] {
589
+ grid-column: 1;
590
+ }
591
+ }
592
+
593
+ .apple-site-footer:not([data-directory]) .apple-site-footer__inner {
594
+ padding-block: 1.25rem;
595
+ }
596
+ .apple-site-footer:not([data-directory]) .apple-site-footer__bottom {
597
+ padding-top: 0;
598
+ border-top: 0;
599
+ }