starlight-theme-apple 0.5.0 → 0.7.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/index.ts CHANGED
@@ -121,7 +121,7 @@ export default function starlightThemeApple(): StarlightPlugin {
121
121
  ...userExpressiveCodeConfig,
122
122
  styleOverrides: {
123
123
  borderColor: "var(--apple-hairline)",
124
- borderRadius: "var(--apple-radius-sm)",
124
+ borderRadius: "var(--apple-radius-panel)",
125
125
  ...userExpressiveCodeConfig.styleOverrides,
126
126
  frames: {
127
127
  editorActiveTabIndicatorTopColor: "unset",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starlight-theme-apple",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "description": "An Apple Developer Documentation-inspired theme for Astro Starlight.",
5
5
  "keywords": [
6
6
  "starlight",
package/styles/base.css CHANGED
@@ -63,12 +63,12 @@ select:disabled {
63
63
  }
64
64
 
65
65
  .sl-banner {
66
- max-width: var(--apple-content-width);
66
+ width: 100%;
67
+ max-width: none;
67
68
  margin-block: 2rem 1rem;
68
- margin-inline: var(--sl-content-pad-x);
69
- padding: 0.875rem 1.125rem;
70
- border: 1px solid var(--apple-border);
71
- border-radius: 0.75rem;
69
+ margin-inline: 0;
70
+ padding: 0.875rem var(--sl-content-pad-x);
71
+ border-block: 1px solid var(--apple-border);
72
72
  background: var(--apple-aside-background);
73
73
  box-shadow: none;
74
74
  color: var(--apple-foreground);
package/styles/code.css CHANGED
@@ -9,7 +9,7 @@
9
9
  }
10
10
 
11
11
  .expressive-code {
12
- --ec-brdRad: 0.75rem;
12
+ --ec-brdRad: var(--apple-radius-panel);
13
13
  --ec-brdWd: 1px;
14
14
  margin-block: 1.5rem;
15
15
  }
@@ -2,7 +2,7 @@
2
2
  padding-bottom: 4rem;
3
3
  }
4
4
  .content-panel:first-of-type .sl-container {
5
- padding-top: clamp(2.5rem, 6vw, 5rem);
5
+ padding-top: clamp(2.5rem, 5vw, 4rem);
6
6
  }
7
7
 
8
8
  .apple-breadcrumbs {
@@ -75,7 +75,7 @@
75
75
  .sl-markdown-content {
76
76
  color: var(--apple-foreground);
77
77
  font-size: 1.0625rem;
78
- line-height: 1.5625rem;
78
+ line-height: 1.65;
79
79
  }
80
80
  .sl-markdown-content > :first-child {
81
81
  margin-top: 0;
@@ -116,8 +116,8 @@
116
116
  }
117
117
  .sl-markdown-content h3:not(:where(.not-content *)) {
118
118
  color: var(--apple-foreground);
119
- font-size: 1.75rem;
120
- font-weight: 500;
119
+ font-size: 1.375rem;
120
+ font-weight: 600;
121
121
  line-height: 2rem;
122
122
  letter-spacing: -0.012em;
123
123
  }
@@ -127,13 +127,13 @@
127
127
  }
128
128
  .sl-markdown-content h4:not(:where(.not-content *)) {
129
129
  color: var(--apple-foreground);
130
- font-size: 1.5rem;
130
+ font-size: 1.125rem;
131
131
  font-weight: 600;
132
- line-height: 1.75rem;
132
+ line-height: 1.5rem;
133
133
  }
134
134
  .sl-markdown-content h5:not(:where(.not-content *)) {
135
- font-size: 1.375rem;
136
- line-height: 1.625rem;
135
+ font-size: 1.0625rem;
136
+ line-height: 1.5rem;
137
137
  }
138
138
  .sl-markdown-content h6:not(:where(.not-content *)) {
139
139
  font-size: 1.0625rem;
@@ -211,8 +211,8 @@
211
211
  .sl-markdown-content details:not(:where(.not-content *)) {
212
212
  overflow: clip;
213
213
  padding: 0;
214
- border: 1px solid var(--apple-border);
215
- border-radius: 0.75rem;
214
+ border: 1px solid var(--apple-hairline);
215
+ border-radius: var(--apple-radius-panel);
216
216
  background: var(--apple-secondary-background);
217
217
  }
218
218
  .sl-markdown-content details > summary:not(:where(.not-content *)) {
@@ -237,48 +237,123 @@
237
237
  .sl-markdown-content .card,
238
238
  .sl-markdown-content .sl-link-card {
239
239
  border: 1px solid var(--apple-hairline);
240
- border-radius: 0.75rem;
241
- background: var(--apple-secondary-background);
240
+ border-radius: 0.875rem;
241
+ background: var(--apple-card-background);
242
242
  box-shadow: none;
243
243
  }
244
244
  .sl-markdown-content .card {
245
+ min-height: 100%;
245
246
  padding: 1.25rem;
247
+ gap: 0.75rem;
248
+ }
249
+ .sl-markdown-content .card .title {
250
+ align-items: center;
251
+ gap: 0.75rem;
252
+ margin: 0;
253
+ color: var(--apple-foreground);
254
+ font-size: 1.0625rem;
255
+ font-weight: 600;
256
+ line-height: 1.375rem;
257
+ }
258
+ .sl-markdown-content .card .body {
259
+ margin: 0;
260
+ color: var(--apple-secondary-foreground);
261
+ font-size: 0.9375rem;
262
+ line-height: 1.5rem;
263
+ }
264
+ .sl-markdown-content .card .body > :first-child {
265
+ margin-top: 0;
266
+ }
267
+ .sl-markdown-content .card .body > :last-child {
268
+ margin-bottom: 0;
246
269
  }
247
270
  .sl-markdown-content .card-grid {
271
+ align-items: stretch;
248
272
  gap: 1rem;
249
273
  }
250
274
  .sl-markdown-content .card-grid.stagger {
251
- --stagger-height: 2rem;
275
+ --stagger-height: 1.5rem;
276
+ }
277
+ .sl-markdown-content .card .title .icon {
278
+ box-sizing: border-box;
279
+ flex: 0 0 2rem;
280
+ width: 2rem;
281
+ height: 2rem;
282
+ padding: 0.4375rem;
283
+ border: 1px solid var(--apple-hairline);
284
+ border-radius: 0.625rem;
285
+ background: var(--apple-hover-surface);
286
+ color: var(--apple-link);
287
+ font-size: 1.125rem;
288
+ }
289
+ .sl-markdown-content .sl-link-card {
290
+ min-height: 100%;
291
+ transition:
292
+ transform var(--apple-transition),
293
+ border-color var(--apple-transition),
294
+ background-color var(--apple-transition),
295
+ box-shadow var(--apple-transition);
296
+ }
297
+ .sl-markdown-content .sl-link-card:is(:hover, :focus-within) {
298
+ border-color: color-mix(
299
+ in srgb,
300
+ var(--apple-link) 45%,
301
+ var(--apple-hairline)
302
+ );
303
+ background: var(--apple-hover-surface);
304
+ box-shadow: none;
305
+ text-decoration: none;
252
306
  }
253
- .sl-markdown-content .card .title,
254
307
  .sl-markdown-content .sl-link-card .title {
255
308
  color: var(--apple-foreground);
256
309
  font-size: 1rem;
257
310
  font-weight: 600;
311
+ line-height: 1.375rem;
258
312
  }
259
- .sl-markdown-content .card .title .icon {
313
+ .sl-markdown-content .sl-link-card:hover .title,
314
+ .sl-markdown-content .sl-link-card:focus-within .title {
260
315
  color: var(--apple-link);
261
- font-size: 1.5rem;
262
- }
263
- .sl-markdown-content .sl-link-card:is(:hover, :focus-visible) {
264
- border-color: var(--apple-border);
265
- background: var(--apple-hover-surface);
266
- box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
267
- text-decoration: none;
268
316
  }
269
317
  .sl-markdown-content .sl-link-card .description {
270
318
  color: var(--apple-secondary-foreground);
319
+ font-size: 0.9375rem;
320
+ line-height: 1.4375rem;
271
321
  }
272
322
  .sl-markdown-content .sl-link-card .icon {
273
- color: var(--apple-tertiary-foreground);
323
+ align-self: start;
324
+ margin-top: 0.125rem;
325
+ color: var(--apple-link);
326
+ transition: transform var(--apple-transition);
327
+ }
328
+ .sl-markdown-content .sl-link-card:hover .icon,
329
+ .sl-markdown-content .sl-link-card:focus-within .icon {
330
+ transform: translateX(0.125rem);
331
+ }
332
+ .sl-markdown-content .sl-link-card a:focus-visible {
333
+ outline: 0;
334
+ }
335
+ .sl-markdown-content .sl-link-card:focus-within {
336
+ outline: 3px solid var(--apple-focus);
337
+ outline-offset: 2px;
338
+ }
339
+ @media (prefers-reduced-motion: reduce) {
340
+ .sl-markdown-content .sl-link-card,
341
+ .sl-markdown-content .sl-link-card .icon {
342
+ transition: none;
343
+ }
344
+ .sl-markdown-content .sl-link-card:is(:hover, :focus-within),
345
+ .sl-markdown-content .sl-link-card:hover .icon,
346
+ .sl-markdown-content .sl-link-card:focus-within .icon {
347
+ transform: none;
348
+ }
274
349
  }
275
350
 
276
351
  .starlight-aside {
277
352
  --apple-aside-accent: var(--apple-secondary-foreground);
278
353
  margin-block: 1.5rem;
279
354
  padding: 1rem 1.125rem;
280
- border: 1px solid var(--apple-border);
281
- border-radius: 0.75rem;
355
+ border: 1px solid var(--apple-hairline);
356
+ border-radius: var(--apple-radius-panel);
282
357
  background: var(--apple-aside-background);
283
358
  color: var(--apple-foreground);
284
359
  box-shadow: none;
@@ -296,6 +371,7 @@
296
371
  display: none;
297
372
  }
298
373
  .starlight-aside__title {
374
+ margin: 0;
299
375
  color: var(--apple-aside-accent);
300
376
  font-size: 0.9375rem;
301
377
  font-weight: 500;
@@ -304,6 +380,12 @@
304
380
  .starlight-aside__title + * {
305
381
  margin-top: 0.375rem;
306
382
  }
383
+ .sl-markdown-content .starlight-aside :is(p, ul, ol) {
384
+ margin-block: 0.5rem;
385
+ }
386
+ .sl-markdown-content .starlight-aside .starlight-aside__title {
387
+ margin: 0;
388
+ }
307
389
  .starlight-aside__content > :first-child {
308
390
  margin-top: 0;
309
391
  }
@@ -359,6 +441,7 @@
359
441
  text-decoration: none;
360
442
  }
361
443
  .pagination-links > a[rel="next"] {
444
+ grid-column: 2;
362
445
  justify-content: flex-end;
363
446
  text-align: end;
364
447
  }
@@ -8,7 +8,7 @@
8
8
  min-height: 2.0625rem;
9
9
  padding: 0.25rem 0.9375rem;
10
10
  border: 0;
11
- border-radius: 0.25rem;
11
+ border-radius: var(--apple-radius-sm);
12
12
  box-shadow: none;
13
13
  font-size: 1.0625rem;
14
14
  font-weight: 400;
@@ -128,7 +128,8 @@
128
128
  padding-inline: 0.5rem;
129
129
  border: 0;
130
130
  border-radius: 999px;
131
- background: color-mix(in srgb, currentColor 14%, transparent);
131
+ background: var(--sl-color-bg-badge);
132
+ color: var(--sl-color-text-badge);
132
133
  font-weight: 600;
133
134
  line-height: 1.2;
134
135
  vertical-align: 0.08em;
@@ -144,6 +145,9 @@
144
145
  font-size: 0.6875rem;
145
146
  line-height: 1;
146
147
  }
148
+ .sidebar-content a[aria-current="page"] > .sl-badge {
149
+ color: inherit;
150
+ }
147
151
 
148
152
  .sl-markdown-content :is(input, select, textarea):not(:where(.not-content *)) {
149
153
  min-height: 2.25rem;
@@ -158,7 +162,7 @@
158
162
  min-height: 2.0625rem;
159
163
  padding: 0.25rem 0.9375rem;
160
164
  border: 0;
161
- border-radius: 0.25rem;
165
+ border-radius: var(--apple-radius-sm);
162
166
  background: var(--apple-button-background);
163
167
  color: var(--apple-control-primary-text);
164
168
  box-shadow: none;
@@ -14,10 +14,16 @@
14
14
  :root {
15
15
  --sl-mobile-toc-height: 0rem;
16
16
  }
17
- .main-frame {
18
- grid-template-columns: var(--apple-sidebar-width) minmax(0, 1fr) var(
19
- --apple-toc-width
20
- );
17
+ /* Starlight's columns are flex children inside the main frame. */
18
+ [data-has-sidebar][data-has-toc] .main-pane {
19
+ flex: 1;
20
+ width: calc(100% - var(--apple-toc-width));
21
+ min-width: 0;
22
+ --sl-content-margin-inline: auto;
23
+ }
24
+ .right-sidebar-container {
25
+ flex: 0 0 var(--apple-toc-width);
26
+ width: var(--apple-toc-width);
21
27
  }
22
28
  .main-pane main {
23
29
  margin-inline: auto;
@@ -36,11 +42,11 @@
36
42
  line-height: 2.25rem;
37
43
  }
38
44
  .sl-markdown-content h3:not(:where(.not-content *)) {
39
- font-size: 1.5rem;
45
+ font-size: 1.375rem;
40
46
  line-height: 1.75rem;
41
47
  }
42
48
  .sl-markdown-content h4:not(:where(.not-content *)) {
43
- font-size: 1.3125rem;
49
+ font-size: 1.125rem;
44
50
  line-height: 1.5625rem;
45
51
  }
46
52
  }
@@ -90,17 +96,20 @@
90
96
  line-height: 2rem;
91
97
  }
92
98
  .sl-markdown-content h3:not(:where(.not-content *)) {
93
- font-size: 1.3125rem;
99
+ font-size: 1.125rem;
94
100
  line-height: 1.5625rem;
95
101
  }
96
102
  .sl-markdown-content h4:not(:where(.not-content *)) {
97
- font-size: 1.1875rem;
103
+ font-size: 1.0625rem;
98
104
  line-height: 1.4375rem;
99
105
  }
100
106
  .pagination-links {
101
107
  grid-template-columns: 1fr;
102
108
  gap: 1rem;
103
109
  }
110
+ .pagination-links > a[rel="next"] {
111
+ grid-column: 1;
112
+ }
104
113
  .hero {
105
114
  gap: 2.5rem;
106
115
  padding-block: 3.5rem;
package/styles/search.css CHANGED
@@ -2,7 +2,7 @@ site-search > button {
2
2
  min-height: 2rem;
3
3
  border: 1px solid var(--apple-hairline);
4
4
  border-radius: var(--apple-radius-sm);
5
- background: transparent;
5
+ background: var(--apple-code-background);
6
6
  color: var(--apple-secondary-foreground);
7
7
  box-shadow: none;
8
8
  font-size: 0.8125rem;
@@ -4,14 +4,14 @@
4
4
  }
5
5
 
6
6
  .sidebar-content {
7
- padding-top: 1rem;
7
+ padding-top: 1.5rem;
8
8
  scrollbar-color: var(--apple-border) transparent;
9
9
  }
10
10
 
11
11
  .sidebar-content .top-level {
12
12
  display: flex;
13
13
  flex-direction: column;
14
- gap: 0.75rem;
14
+ gap: 1rem;
15
15
  }
16
16
  .sidebar-content .top-level > li {
17
17
  margin-block: 0;
@@ -76,10 +76,10 @@
76
76
  }
77
77
  .sidebar-content a[aria-current="page"] {
78
78
  background: var(--apple-active-surface);
79
- color: var(--apple-foreground);
79
+ color: var(--apple-link);
80
80
  font-weight: 500;
81
81
  }
82
82
  .sidebar-content a[aria-current="page"]:is(:hover, :focus-visible) {
83
83
  background: var(--apple-active-surface);
84
- color: var(--apple-foreground);
84
+ color: var(--apple-link);
85
85
  }
package/styles/toc.css CHANGED
@@ -6,6 +6,9 @@
6
6
  .right-sidebar-panel {
7
7
  padding-top: 2.5rem;
8
8
  }
9
+ .right-sidebar-panel .sl-container {
10
+ max-width: none;
11
+ }
9
12
  .right-sidebar h2 {
10
13
  margin-bottom: 0.625rem;
11
14
  color: var(--apple-foreground);
@@ -21,12 +24,16 @@
21
24
  padding-inline-start: 0.75rem;
22
25
  }
23
26
  .right-sidebar a {
24
- margin-block: 0.3125rem;
25
- padding: 0;
26
- border-inline-start: 0;
27
+ margin-block: 0;
28
+ padding: 0.25rem 0.75rem;
29
+ border-inline-start: 1px solid var(--apple-hairline);
27
30
  color: var(--apple-secondary-foreground);
28
31
  font-size: 0.875rem;
29
32
  line-height: 1.125rem;
33
+ overflow-wrap: anywhere;
34
+ }
35
+ .right-sidebar a span {
36
+ white-space: normal;
30
37
  }
31
38
  .right-sidebar a:hover {
32
39
  color: var(--apple-link);
@@ -37,7 +44,8 @@
37
44
  outline-offset: 2px;
38
45
  }
39
46
  .right-sidebar a[aria-current="true"] {
40
- color: var(--apple-foreground);
47
+ border-inline-start-color: var(--apple-link);
48
+ color: var(--apple-link);
41
49
  font-weight: 500;
42
50
  }
43
51
 
package/styles/tokens.css CHANGED
@@ -1,12 +1,13 @@
1
1
  :root {
2
2
  color-scheme: dark;
3
- --apple-background: #111;
4
- --apple-navigator-background: #161616;
3
+ --apple-background: #161617;
4
+ --apple-navigator-background: #1c1c1e;
5
5
  --apple-secondary-background: #1c1c1e;
6
+ --apple-card-background: #1c1c1e;
6
7
  --apple-surface: #2a2a2a;
7
8
  --apple-hover-surface: rgba(0, 153, 255, 0.08);
8
- --apple-active-surface: rgba(255, 255, 255, 0.1);
9
- --apple-foreground: #fff;
9
+ --apple-active-surface: rgba(0, 153, 255, 0.14);
10
+ --apple-foreground: #f5f5f7;
10
11
  --apple-secondary-foreground: #ccc;
11
12
  --apple-tertiary-foreground: #999;
12
13
  --apple-hairline: rgba(255, 255, 255, 0.12);
@@ -21,7 +22,7 @@
21
22
  --apple-button-secondary-hover: #2a2a2a;
22
23
  --apple-control-primary-text: #fff;
23
24
  --apple-disabled-opacity: 0.42;
24
- --apple-header-background: rgba(17, 17, 17, 0.82);
25
+ --apple-header-background: rgba(22, 22, 23, 0.88);
25
26
  --apple-code-background: #1c1c1e;
26
27
  --apple-aside-background: #1c1c1e;
27
28
  --apple-note: #8e8e93;
@@ -35,11 +36,12 @@
35
36
  ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
36
37
  monospace;
37
38
  --apple-header-height: 3.25rem;
38
- --apple-sidebar-width: 18.5rem;
39
- --apple-toc-width: 12rem;
40
- --apple-content-width: 51.25rem;
39
+ --apple-sidebar-width: 17rem;
40
+ --apple-toc-width: 14rem;
41
+ --apple-content-width: 48rem;
41
42
  --apple-row-height: 2rem;
42
- --apple-radius-sm: 0.25rem;
43
+ --apple-radius-sm: 0.375rem;
44
+ --apple-radius-panel: 0.75rem;
43
45
  --apple-transition: 120ms ease;
44
46
  --apple-section-spacing: 2.5rem;
45
47
  --sl-font: var(--apple-font-sans);
@@ -79,18 +81,19 @@
79
81
  --apple-background: #fff;
80
82
  --apple-navigator-background: #f7f7f7;
81
83
  --apple-secondary-background: #fff;
84
+ --apple-card-background: #f5f5f7;
82
85
  --apple-surface: #f0f0f0;
83
86
  --apple-hover-surface: rgba(51, 102, 255, 0.05);
84
- --apple-active-surface: rgba(0, 0, 0, 0.06);
85
- --apple-foreground: #000;
86
- --apple-secondary-foreground: #666;
87
+ --apple-active-surface: rgba(0, 102, 204, 0.08);
88
+ --apple-foreground: #1d1d1f;
89
+ --apple-secondary-foreground: #6e6e73;
87
90
  --apple-tertiary-foreground: #767676;
88
91
  --apple-hairline: rgba(0, 0, 0, 0.12);
89
92
  --apple-border: #ccc;
90
- --apple-link: #36f;
93
+ --apple-link: #0066cc;
91
94
  --apple-link-hover: #174ea6;
92
95
  --apple-focus: rgba(51, 102, 255, 0.24);
93
- --apple-button-background: #00f;
96
+ --apple-button-background: #0071e3;
94
97
  --apple-button-background-hover: #36f;
95
98
  --apple-button-background-active: #36f;
96
99
  --apple-button-secondary-background: #f7f7f7;
@@ -99,6 +102,9 @@
99
102
  --apple-header-background: rgba(255, 255, 255, 0.82);
100
103
  --apple-code-background: #f5f5f7;
101
104
  --apple-aside-background: #f5f5f7;
105
+ --apple-warning: #9a5700;
106
+ --apple-danger: #c7362c;
107
+ --apple-success: #21783b;
102
108
  --sl-color-accent-low: #e8f2ff;
103
109
  --sl-color-accent-high: #004b99;
104
110
  --sl-color-gray-1: #2c2c2e;