starlight-theme-apple 0.7.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 -425
  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 +51 -44
  28. package/styles/tokens.css +130 -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 -157
package/styles/base.css CHANGED
@@ -1,89 +1,69 @@
1
1
  html {
2
- scroll-padding-top: calc(var(--apple-header-height) + 1.5rem);
3
- text-rendering: optimizeLegibility;
2
+ -webkit-text-size-adjust: 100%;
3
+ text-size-adjust: 100%;
4
4
  }
5
5
 
6
6
  body {
7
7
  background: var(--apple-background);
8
8
  color: var(--apple-foreground);
9
9
  font-family: var(--apple-font-sans);
10
- font-size: 1.0625rem;
11
- line-height: 1.4706;
10
+ font-size: var(--sl-text-body);
11
+ line-height: var(--sl-line-height);
12
+ letter-spacing: -0.022em;
12
13
  -webkit-font-smoothing: antialiased;
13
14
  -moz-osx-font-smoothing: grayscale;
15
+ font-synthesis-weight: none;
14
16
  }
15
17
 
16
18
  ::selection {
17
- background: var(--apple-focus);
19
+ background: color-mix(in srgb, var(--apple-link) 28%, transparent);
18
20
  }
21
+
19
22
  :focus-visible {
20
23
  outline: 2px solid var(--apple-link);
21
- outline-offset: 3px;
24
+ outline-offset: 2px;
22
25
  }
23
26
 
24
- a,
25
- button,
26
- [role="button"],
27
- summary,
28
- input,
29
- select {
30
- transition:
31
- color var(--apple-transition),
32
- background-color var(--apple-transition),
33
- border-color var(--apple-transition),
34
- box-shadow var(--apple-transition),
35
- opacity var(--apple-transition);
27
+ :is(a, button, summary, select, input) {
28
+ transition-property:
29
+ color, background-color, border-color, box-shadow, opacity;
30
+ transition-duration: 160ms;
31
+ transition-timing-function: var(--apple-transition-easing);
36
32
  }
37
33
 
38
- :is(button, input, select, summary, a)[aria-disabled="true"],
39
- button:disabled,
40
- input:disabled,
41
- select:disabled {
42
- cursor: not-allowed;
43
- opacity: var(--apple-disabled-opacity);
34
+ code,
35
+ kbd,
36
+ pre,
37
+ samp {
38
+ letter-spacing: normal;
44
39
  }
45
40
 
46
- .main-frame,
47
- .main-pane {
48
- background: var(--apple-background);
49
- }
50
- .main-pane,
51
- .main-pane main {
52
- min-width: 0;
53
- }
54
- .content-panel {
55
- padding-block: 0;
56
- }
57
- .content-panel + .content-panel,
58
- .main-pane > main > .content-panel:last-of-type {
41
+ /* Starlight’s panels stack in one column; Apple pages flow without dividing rules. */
42
+ .content-panel + .content-panel {
59
43
  border-top: 0;
60
44
  }
61
- .sl-container {
62
- max-width: var(--apple-content-width);
45
+ .main-pane main {
46
+ padding-bottom: 5rem;
63
47
  }
64
48
 
65
49
  .sl-banner {
66
- width: 100%;
67
- max-width: none;
68
- margin-block: 2rem 1rem;
69
- margin-inline: 0;
70
- padding: 0.875rem var(--sl-content-pad-x);
71
- border-block: 1px solid var(--apple-border);
72
- background: var(--apple-aside-background);
73
- box-shadow: none;
50
+ padding: 0.75rem var(--sl-content-pad-x);
51
+ border-bottom: 1px solid var(--apple-hairline);
52
+ background: var(--apple-secondary-background);
74
53
  color: var(--apple-foreground);
75
- text-align: start;
54
+ font-size: 0.9375rem;
55
+ line-height: 1.4;
56
+ text-align: center;
76
57
  }
77
58
  .sl-banner a {
78
59
  color: var(--apple-link);
79
60
  }
80
61
 
81
62
  .sl-skip-link {
82
- border: 1px solid var(--apple-border);
83
- border-radius: 0.5rem;
84
- background: var(--apple-secondary-background);
85
- color: var(--apple-link);
86
- box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
63
+ border-radius: var(--apple-radius-sm);
64
+ background: var(--apple-button-background);
65
+ color: var(--apple-button-foreground);
66
+ font-size: 0.875rem;
87
67
  }
88
68
 
89
69
  @media (prefers-reduced-motion: reduce) {
@@ -92,5 +72,7 @@ select:disabled {
92
72
  *::after {
93
73
  scroll-behavior: auto !important;
94
74
  transition-duration: 0.01ms !important;
75
+ animation-duration: 0.01ms !important;
76
+ animation-iteration-count: 1 !important;
95
77
  }
96
78
  }
package/styles/code.css CHANGED
@@ -1,88 +1,12 @@
1
- .sl-markdown-content :not(pre) > code:not(:where(.not-content *)) {
2
- padding: 0;
3
- border: 0;
4
- border-radius: 0;
5
- background: transparent;
6
- color: inherit;
7
- font-family: var(--apple-font-mono);
8
- font-size: 0.88em;
9
- }
10
-
11
- .expressive-code {
12
- --ec-brdRad: var(--apple-radius-panel);
13
- --ec-brdWd: 1px;
1
+ /* Code blocks are styled through Expressive Code’s `styleOverrides` (see libs/expressive-code.ts). */
2
+ .sl-markdown-content .expressive-code {
14
3
  margin-block: 1.5rem;
15
4
  }
16
- .expressive-code figure.frame {
17
- box-shadow: none !important;
18
- }
19
- .expressive-code .frame .header {
20
- min-height: 2.25rem;
21
- border-color: var(--apple-hairline) !important;
22
- background: var(--apple-code-background) !important;
23
- }
24
- .expressive-code .frame .title {
25
- color: var(--apple-secondary-foreground) !important;
26
- font-family: var(--apple-font-sans) !important;
27
- font-size: 0.8125rem !important;
28
- font-weight: 500 !important;
5
+ .expressive-code .frame.has-title:not(.is-terminal) .title,
6
+ .expressive-code .frame.is-terminal .title {
7
+ font-weight: 600;
8
+ letter-spacing: -0.008em;
29
9
  }
30
10
  .expressive-code pre {
31
- border-color: var(--apple-hairline) !important;
32
- background: var(--apple-code-background) !important;
33
- }
34
- .expressive-code pre code {
35
- font-size: 0.9375rem !important;
36
- line-height: 1.5625rem !important;
37
- }
38
- .expressive-code .copy button {
39
- border-color: var(--apple-hairline) !important;
40
- border-radius: 0.5rem !important;
41
- background: var(--apple-secondary-background) !important;
42
- color: var(--apple-secondary-foreground) !important;
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
- }
67
- .expressive-code .copy button:is(:hover, :focus-visible) {
68
- border-color: var(--apple-border) !important;
69
- background: var(--apple-active-surface) !important;
70
- color: var(--apple-foreground) !important;
71
- }
72
- .sl-markdown-content starlight-file-tree {
73
- display: block;
74
- margin-block: 1.5rem;
75
- padding: 1rem;
76
- border: 1px solid var(--apple-hairline);
77
- border-radius: 0.75rem;
78
- background: var(--apple-code-background);
79
- }
80
- .sl-markdown-content starlight-file-tree .tree-entry {
81
- min-height: 1.75rem;
82
- }
83
- .sl-markdown-content starlight-file-tree .tree-icon {
84
- color: var(--apple-tertiary-foreground);
85
- }
86
- .sl-markdown-content starlight-file-tree .comment {
87
- color: var(--apple-tertiary-foreground);
11
+ scrollbar-width: thin;
88
12
  }