starlight-theme-apple 0.3.0 → 0.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starlight-theme-apple",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "An Apple Developer Documentation-inspired theme for Astro Starlight.",
5
5
  "keywords": [
6
6
  "starlight",
package/styles/code.css CHANGED
@@ -9,7 +9,7 @@
9
9
  }
10
10
 
11
11
  .expressive-code {
12
- --ec-brdRad: var(--apple-radius-sm);
12
+ --ec-brdRad: 0.75rem;
13
13
  --ec-brdWd: 1px;
14
14
  margin-block: 1.5rem;
15
15
  }
@@ -37,10 +37,33 @@
37
37
  }
38
38
  .expressive-code .copy button {
39
39
  border-color: var(--apple-hairline) !important;
40
- border-radius: var(--apple-radius-sm) !important;
40
+ border-radius: 0.5rem !important;
41
41
  background: var(--apple-secondary-background) !important;
42
42
  color: var(--apple-secondary-foreground) !important;
43
43
  }
44
+
45
+ .sl-markdown-content kbd:not(:where(.not-content *)) {
46
+ display: inline-flex;
47
+ align-items: center;
48
+ min-height: 1.5rem;
49
+ padding-inline: 0.4rem;
50
+ border: 1px solid var(--apple-border);
51
+ border-bottom-width: 2px;
52
+ border-radius: 0.35rem;
53
+ background: var(--apple-secondary-background);
54
+ color: var(--apple-secondary-foreground);
55
+ font-family: var(--apple-font-sans);
56
+ font-size: 0.8125rem;
57
+ line-height: 1;
58
+ vertical-align: 0.08em;
59
+ }
60
+
61
+ .sl-markdown-content mark:not(:where(.not-content *)) {
62
+ padding-inline: 0.15em;
63
+ border-radius: 0.2em;
64
+ background: color-mix(in srgb, var(--apple-warning) 28%, transparent);
65
+ color: var(--apple-foreground);
66
+ }
44
67
  .expressive-code .copy button:is(:hover, :focus-visible) {
45
68
  border-color: var(--apple-border) !important;
46
69
  background: var(--apple-active-surface) !important;
@@ -3,62 +3,77 @@
3
3
  display: inline-flex;
4
4
  align-items: center;
5
5
  justify-content: center;
6
- gap: 0.4rem;
7
- min-height: 2.25rem;
8
- padding: 0.45rem 0.875rem;
9
- border: 1px solid transparent;
10
- border-radius: var(--apple-radius-sm);
6
+ gap: 0.375rem;
7
+ min-width: 1.875rem;
8
+ min-height: 2.0625rem;
9
+ padding: 0.25rem 0.9375rem;
10
+ border: 0;
11
+ border-radius: 0.25rem;
11
12
  box-shadow: none;
12
- font-size: 0.875rem;
13
- font-weight: 600;
14
- line-height: 1.25rem;
13
+ font-size: 1.0625rem;
14
+ font-weight: 400;
15
+ line-height: 1.5625rem;
16
+ letter-spacing: normal;
15
17
  text-decoration: none;
18
+ cursor: pointer;
19
+ transition:
20
+ color var(--apple-transition),
21
+ background-color var(--apple-transition),
22
+ border-color var(--apple-transition),
23
+ box-shadow var(--apple-transition);
16
24
  }
17
25
  .sl-markdown-content .sl-link-button + .sl-link-button {
18
26
  margin-inline-start: 0.5rem;
19
27
  }
20
28
  .hero .sl-link-button {
21
- min-height: 2.5rem;
22
- padding: 0.55rem 1rem;
29
+ min-height: 2.0625rem;
30
+ padding: 0.25rem 0.9375rem;
23
31
  }
24
32
  .hero .sl-link-button svg,
25
33
  .sl-markdown-content .sl-link-button svg {
26
34
  flex-shrink: 0;
27
- font-size: 1.125rem;
35
+ font-size: 1rem;
28
36
  }
29
37
 
30
38
  :is(.hero, .sl-markdown-content) .sl-link-button.primary {
31
- border-color: var(--apple-link);
32
- background: var(--apple-link);
39
+ background: var(--apple-button-background);
33
40
  color: var(--apple-control-primary-text);
34
41
  }
35
42
  :is(.hero, .sl-markdown-content)
36
43
  .sl-link-button.primary:is(:hover, :focus-visible) {
37
- border-color: var(--apple-link-hover);
38
- background: var(--apple-link-hover);
44
+ background: var(--apple-button-background-hover);
39
45
  color: var(--apple-control-primary-text);
40
46
  text-decoration: none;
41
47
  }
48
+ :is(.hero, .sl-markdown-content) .sl-link-button.primary:active {
49
+ background: var(--apple-button-background-active);
50
+ }
42
51
  :is(.hero, .sl-markdown-content) .sl-link-button.secondary {
43
- border-color: var(--apple-border);
44
- background: transparent;
45
- color: var(--apple-foreground);
52
+ background: var(--apple-button-secondary-background);
53
+ color: var(--apple-link);
46
54
  }
47
55
  :is(.hero, .sl-markdown-content)
48
56
  .sl-link-button.secondary:is(:hover, :focus-visible) {
49
- background: var(--apple-active-surface);
50
- color: var(--apple-foreground);
57
+ background: var(--apple-button-secondary-hover);
58
+ color: var(--apple-link);
51
59
  text-decoration: none;
52
60
  }
53
61
  :is(.hero, .sl-markdown-content) .sl-link-button.minimal {
62
+ min-width: 0;
63
+ padding-inline: 0;
54
64
  background: transparent;
55
65
  color: var(--apple-link);
56
66
  }
57
67
  :is(.hero, .sl-markdown-content)
58
68
  .sl-link-button.minimal:is(:hover, :focus-visible) {
59
- background: var(--apple-hover-surface);
60
- color: var(--apple-link-hover);
61
- text-decoration: none;
69
+ background: transparent;
70
+ color: var(--apple-link);
71
+ text-decoration: underline;
72
+ text-underline-offset: 0.14em;
73
+ }
74
+ :is(.hero, .sl-markdown-content) .sl-link-button:focus-visible {
75
+ outline: 0;
76
+ box-shadow: 0 0 0 4px var(--apple-focus);
62
77
  }
63
78
 
64
79
  .sl-markdown-content starlight-tabs {
@@ -130,15 +145,41 @@
130
145
  line-height: 1;
131
146
  }
132
147
 
133
- .sl-markdown-content
134
- :is(input, select, textarea, button):not(:where(.not-content *)) {
148
+ .sl-markdown-content :is(input, select, textarea):not(:where(.not-content *)) {
135
149
  min-height: 2.25rem;
136
150
  border: 1px solid var(--apple-border);
137
- border-radius: var(--apple-radius-sm);
151
+ border-radius: 0.5rem;
138
152
  background: var(--apple-secondary-background);
139
153
  color: var(--apple-foreground);
140
154
  font: inherit;
141
155
  }
156
+ .sl-markdown-content button:not(:where(.not-content *)) {
157
+ min-width: 1.875rem;
158
+ min-height: 2.0625rem;
159
+ padding: 0.25rem 0.9375rem;
160
+ border: 0;
161
+ border-radius: 0.25rem;
162
+ background: var(--apple-button-background);
163
+ color: var(--apple-control-primary-text);
164
+ box-shadow: none;
165
+ font: inherit;
166
+ font-size: 1.0625rem;
167
+ font-weight: 400;
168
+ line-height: 1.5625rem;
169
+ cursor: pointer;
170
+ }
171
+ .sl-markdown-content
172
+ button:is(:hover, :focus-visible):not(:where(.not-content *)) {
173
+ background: var(--apple-button-background-hover);
174
+ }
175
+ .sl-markdown-content button:active:not(:where(.not-content *)) {
176
+ background: var(--apple-button-background-active);
177
+ box-shadow: none;
178
+ }
179
+ .sl-markdown-content button:focus-visible:not(:where(.not-content *)) {
180
+ outline: 0;
181
+ box-shadow: 0 0 0 4px var(--apple-focus);
182
+ }
142
183
  .sl-markdown-content :is(input, select, textarea):focus {
143
184
  border-color: var(--apple-link);
144
185
  box-shadow: 0 0 0 3px var(--apple-focus);
@@ -112,6 +112,12 @@
112
112
  .hero .actions {
113
113
  gap: 0.625rem;
114
114
  }
115
+ .sl-markdown-content table:not(:where(.not-content *)) {
116
+ display: block;
117
+ max-width: 100%;
118
+ overflow-x: auto;
119
+ overscroll-behavior-inline: contain;
120
+ }
115
121
  }
116
122
  @media (max-width: 30rem) {
117
123
  :root {
@@ -124,10 +130,6 @@
124
130
  font-size: 1.0625rem;
125
131
  line-height: 1.25rem;
126
132
  }
127
- .sl-markdown-content table:not(:where(.not-content *)) {
128
- display: block;
129
- overflow-x: auto;
130
- }
131
133
  .sl-markdown-content .sl-link-button {
132
134
  width: 100%;
133
135
  }
package/styles/search.css CHANGED
@@ -15,10 +15,27 @@ site-search > button[aria-expanded="true"] {
15
15
  }
16
16
  site-search dialog {
17
17
  border: 1px solid var(--apple-border);
18
- border-radius: var(--apple-radius-sm);
18
+ border-radius: 0.75rem;
19
19
  background: var(--apple-secondary-background);
20
20
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
21
21
  }
22
+ site-search > button kbd {
23
+ gap: 0.2rem;
24
+ border: 0;
25
+ background: transparent;
26
+ color: var(--apple-tertiary-foreground);
27
+ font-family: var(--apple-font-sans);
28
+ font-size: 0.6875rem;
29
+ }
30
+ site-search > button kbd kbd {
31
+ min-width: 1.25rem;
32
+ padding: 0.125rem 0.25rem;
33
+ border: 1px solid var(--apple-hairline);
34
+ border-radius: 0.25rem;
35
+ background: var(--apple-secondary-background);
36
+ line-height: 1rem;
37
+ text-align: center;
38
+ }
22
39
  site-search dialog::backdrop {
23
40
  background: rgba(0, 0, 0, 0.3);
24
41
  -webkit-backdrop-filter: blur(4px);
@@ -65,3 +82,7 @@ site-search input:focus {
65
82
  .pagefind-ui__result-excerpt {
66
83
  color: var(--apple-secondary-foreground) !important;
67
84
  }
85
+ .pagefind-ui__message,
86
+ .pagefind-ui__result-nested {
87
+ color: var(--apple-tertiary-foreground) !important;
88
+ }
package/styles/tokens.css CHANGED
@@ -14,7 +14,12 @@
14
14
  --apple-link: #09f;
15
15
  --apple-link-hover: #40b3ff;
16
16
  --apple-focus: rgba(0, 153, 255, 0.35);
17
- --apple-control-primary-text: #000;
17
+ --apple-button-background: #06f;
18
+ --apple-button-background-hover: #09f;
19
+ --apple-button-background-active: #06f;
20
+ --apple-button-secondary-background: #161616;
21
+ --apple-button-secondary-hover: #2a2a2a;
22
+ --apple-control-primary-text: #fff;
18
23
  --apple-disabled-opacity: 0.42;
19
24
  --apple-header-background: rgba(17, 17, 17, 0.82);
20
25
  --apple-code-background: #1c1c1e;
@@ -85,6 +90,11 @@
85
90
  --apple-link: #36f;
86
91
  --apple-link-hover: #174ea6;
87
92
  --apple-focus: rgba(51, 102, 255, 0.24);
93
+ --apple-button-background: #00f;
94
+ --apple-button-background-hover: #36f;
95
+ --apple-button-background-active: #36f;
96
+ --apple-button-secondary-background: #f7f7f7;
97
+ --apple-button-secondary-hover: #f0f0f0;
88
98
  --apple-control-primary-text: #fff;
89
99
  --apple-header-background: rgba(255, 255, 255, 0.82);
90
100
  --apple-code-background: #f5f5f7;