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/search.css CHANGED
@@ -1,88 +1,102 @@
1
- site-search > button {
2
- min-height: 2rem;
3
- border: 1px solid var(--apple-hairline);
4
- border-radius: var(--apple-radius-sm);
5
- background: var(--apple-code-background);
6
- color: var(--apple-secondary-foreground);
7
- box-shadow: none;
8
- font-size: 0.8125rem;
9
- }
10
- site-search > button:is(:hover, :active),
11
- site-search > button[aria-expanded="true"] {
12
- border-color: var(--apple-border);
13
- background: var(--apple-active-surface);
1
+ /* Search field in the navigation bar. */
2
+ @media (min-width: 50rem) {
3
+ site-search > button[data-open-modal] {
4
+ width: clamp(10rem, 16vw, 14rem);
5
+ min-height: 2rem;
6
+ padding-inline: 0.625rem 0.375rem;
7
+ border: 0;
8
+ border-radius: 0.5rem;
9
+ background: var(--apple-fill-secondary);
10
+ color: var(--apple-tertiary-foreground);
11
+ font-size: 0.875rem;
12
+ letter-spacing: -0.016em;
13
+ }
14
+ :root[data-theme="light"] site-search > button[data-open-modal] {
15
+ background: var(--apple-fill-secondary);
16
+ }
17
+ site-search > button[data-open-modal]:hover {
18
+ background: var(--apple-fill);
19
+ color: var(--apple-secondary-foreground);
20
+ }
21
+ }
22
+ site-search > button[data-open-modal] {
14
23
  color: var(--apple-foreground);
15
24
  }
16
- site-search dialog {
17
- border: 1px solid var(--apple-border);
18
- border-radius: 0.75rem;
19
- background: var(--apple-secondary-background);
20
- box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
21
- }
22
- site-search > button kbd {
23
- gap: 0.2rem;
25
+ site-search > button[data-open-modal] > kbd {
26
+ gap: 0.125rem;
24
27
  border: 0;
25
28
  background: transparent;
26
29
  color: var(--apple-tertiary-foreground);
27
- font-family: var(--apple-font-sans);
28
- font-size: 0.6875rem;
30
+ font-size: 0.75rem;
29
31
  }
30
- site-search > button kbd kbd {
31
- min-width: 1.25rem;
32
- padding: 0.125rem 0.25rem;
32
+ site-search > button[data-open-modal] > kbd kbd {
33
+ padding: 0;
34
+ border: 0;
35
+ background: transparent;
36
+ }
37
+
38
+ /* Search dialog and Pagefind results. */
39
+ site-search dialog {
33
40
  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
- }
39
- site-search dialog::backdrop {
40
- background: rgba(0, 0, 0, 0.3);
41
- -webkit-backdrop-filter: blur(4px);
42
- backdrop-filter: blur(4px);
43
- }
44
- site-search input {
45
- min-height: 2.75rem;
46
- border-color: var(--apple-border);
47
- border-radius: var(--apple-radius-sm);
48
- background: var(--apple-code-background);
49
- color: var(--apple-foreground);
41
+ background: var(--apple-background);
42
+ box-shadow: var(--sl-shadow-lg);
43
+ }
44
+ @media (min-width: 50rem) {
45
+ site-search dialog {
46
+ border-radius: var(--apple-radius-panel);
47
+ }
48
+ }
49
+
50
+ #starlight__search {
51
+ --pagefind-ui-primary: var(--apple-link);
52
+ --pagefind-ui-text: var(--apple-foreground);
53
+ --pagefind-ui-font: var(--apple-font-sans);
54
+ --pagefind-ui-background: var(--apple-background);
55
+ --pagefind-ui-border: var(--apple-hairline);
56
+ --pagefind-ui-tag: var(--apple-fill);
57
+ --pagefind-ui-border-radius: 0.625rem;
50
58
  }
51
59
  #starlight__search .pagefind-ui__search-input {
52
- padding-inline: 3.25rem 4.25rem;
53
- }
54
- site-search [data-close-modal] {
55
- min-width: 2.75rem;
56
- min-height: 2.75rem;
57
- padding: 0.5rem;
58
- border-radius: var(--apple-radius-sm);
59
- }
60
- site-search [data-close-modal]:hover {
61
- background: var(--apple-active-surface);
62
- }
63
- site-search input:focus {
64
- border-color: var(--apple-link);
65
- box-shadow: 0 0 0 3px var(--apple-focus);
66
- outline: 0;
67
- }
68
- .pagefind-ui__result {
69
- border-color: var(--apple-hairline) !important;
70
- border-radius: 0;
71
- transition: background-color var(--apple-transition);
60
+ background: var(--apple-fill-secondary);
61
+ color: var(--apple-foreground);
62
+ font-weight: 400;
72
63
  }
73
- .pagefind-ui__result:is(:hover, :focus-within) {
74
- background: var(--apple-hover-surface);
64
+ #starlight__search .pagefind-ui__search-input::placeholder {
65
+ color: var(--apple-tertiary-foreground);
66
+ opacity: 1;
75
67
  }
76
- .pagefind-ui__result-link {
77
- color: var(--apple-foreground) !important;
68
+ #starlight__search .pagefind-ui__search-input:focus {
69
+ outline: 3px solid var(--apple-focus);
70
+ outline-offset: 0;
78
71
  }
79
- .pagefind-ui__result-link:hover {
80
- color: var(--apple-link) !important;
72
+ #starlight__search .pagefind-ui__result-link {
73
+ color: var(--apple-link);
81
74
  }
82
- .pagefind-ui__result-excerpt {
83
- color: var(--apple-secondary-foreground) !important;
75
+ #starlight__search .pagefind-ui__result-excerpt {
76
+ color: var(--apple-secondary-foreground);
84
77
  }
85
- .pagefind-ui__message,
86
- .pagefind-ui__result-nested {
87
- color: var(--apple-tertiary-foreground) !important;
78
+ #starlight__search .pagefind-ui__result-excerpt mark {
79
+ background: transparent;
80
+ color: var(--apple-foreground);
81
+ font-weight: 600;
82
+ }
83
+ #starlight__search
84
+ .pagefind-ui__result-title:not(:where(.pagefind-ui__result-nested *)),
85
+ #starlight__search .pagefind-ui__result-nested {
86
+ border-color: var(--apple-hairline);
87
+ background: var(--apple-fill-secondary);
88
+ }
89
+ #starlight__search
90
+ .pagefind-ui__result-title:not(:where(.pagefind-ui__result-nested *)):hover,
91
+ #starlight__search
92
+ .pagefind-ui__result-title:not(
93
+ :where(.pagefind-ui__result-nested *)
94
+ ):focus-within,
95
+ #starlight__search .pagefind-ui__result-nested:hover,
96
+ #starlight__search .pagefind-ui__result-nested:focus-within {
97
+ outline: 2px solid var(--apple-link);
98
+ outline-offset: -2px;
99
+ }
100
+ site-search button[data-close-modal] {
101
+ color: var(--apple-link);
88
102
  }
@@ -1,85 +1,106 @@
1
+ /* Navigator: neutral rows, gray group headings, a filled selection without accent color. */
1
2
  .sidebar-pane {
2
3
  border-inline-end: 1px solid var(--apple-hairline);
3
- background: var(--apple-navigator-background);
4
+ background: var(--apple-background);
5
+ overscroll-behavior: contain;
6
+ scrollbar-color: var(--apple-hairline) transparent;
7
+ scrollbar-width: thin;
4
8
  }
5
9
 
6
10
  .sidebar-content {
7
- padding-top: 1.5rem;
8
- scrollbar-color: var(--apple-border) transparent;
11
+ gap: 1.5rem;
12
+ padding: 1.25rem var(--sl-sidebar-pad-x) 2.5rem;
9
13
  }
10
14
 
11
- .sidebar-content .top-level {
12
- display: flex;
13
- flex-direction: column;
14
- gap: 1rem;
15
+ .sidebar-content ul {
16
+ --sl-sidebar-item-padding-inline: 0.625rem;
17
+ }
18
+ .sidebar-content li {
19
+ overflow-wrap: break-word;
20
+ }
21
+ .sidebar-content .top-level > li + li {
22
+ margin-top: 1.25rem;
23
+ }
24
+ .sidebar-content ul ul {
25
+ margin-top: 0.125rem;
26
+ }
27
+ .sidebar-content ul ul li {
28
+ margin-inline-start: 0.75rem;
29
+ padding-inline-start: 0;
30
+ border-inline-start: 0;
15
31
  }
16
- .sidebar-content .top-level > li {
17
- margin-block: 0;
32
+ .sidebar-content .top-level > li > details > ul > li {
33
+ margin-inline-start: 0;
18
34
  }
19
35
 
20
- .sidebar-content summary {
21
- min-height: var(--apple-row-height);
22
- padding: 0.34375rem 0.5rem;
36
+ .sidebar-content :is(a, summary) {
37
+ min-height: 2rem;
38
+ padding: 0.3125rem var(--sl-sidebar-item-padding-inline);
23
39
  border-radius: var(--apple-radius-sm);
24
- color: var(--apple-tertiary-foreground);
25
- font-size: 0.875rem;
26
- font-weight: 600;
27
- line-height: 1.3125rem;
28
- letter-spacing: -0.005em;
40
+ font-size: 0.9375rem;
41
+ line-height: 1.375rem;
42
+ letter-spacing: -0.012em;
29
43
  }
30
- .sidebar-content .large,
31
- .sidebar-content a.large {
32
- color: inherit;
44
+
45
+ .sidebar-content .large {
33
46
  font-size: inherit;
34
47
  font-weight: inherit;
48
+ color: inherit;
35
49
  }
36
- .sidebar-content summary:is(:hover, :focus-visible) {
37
- background: var(--apple-hover-surface);
38
- color: var(--apple-secondary-foreground);
39
- }
40
- .sidebar-content .caret {
41
- width: 1rem;
50
+
51
+ /* Top-level groups read as section headings. */
52
+ .sidebar-content .top-level > li > details > summary {
42
53
  color: var(--apple-tertiary-foreground);
43
- opacity: 0.8;
54
+ font-weight: 600;
44
55
  }
45
-
46
- .sidebar-content ul ul {
47
- margin-inline-start: 0.75rem;
48
- padding-inline-start: 0.5rem;
49
- border-inline-start: 0;
56
+ .sidebar-content summary {
57
+ color: var(--apple-foreground);
50
58
  }
51
- .sidebar-content ul ul li {
52
- border-inline-start: 0;
59
+ .sidebar-content summary:hover {
60
+ color: var(--apple-foreground);
53
61
  }
54
- .sidebar-content li {
55
- border: 0;
56
- padding: 0;
62
+ .sidebar-content .caret {
63
+ width: 0.875rem;
64
+ height: 0.875rem;
65
+ color: var(--apple-tertiary-foreground);
66
+ opacity: 0.7;
67
+ }
68
+ .sidebar-content summary:hover .caret {
69
+ opacity: 1;
57
70
  }
58
71
 
59
72
  .sidebar-content a {
60
- min-height: var(--apple-row-height);
61
- margin-block: 0;
62
- padding: 0.34375rem 0.5rem;
63
- border-radius: var(--apple-radius-sm);
64
- color: var(--apple-secondary-foreground);
65
- font-size: 0.875rem;
73
+ display: flex;
74
+ align-items: center;
75
+ gap: 0.375rem;
76
+ color: var(--apple-foreground);
66
77
  font-weight: 400;
67
- line-height: 1.3125rem;
68
- text-decoration: none;
69
78
  }
70
- .sidebar-content a:is(:hover, :focus-visible) {
71
- background: var(--apple-hover-surface);
72
- color: var(--apple-secondary-foreground);
79
+ .sidebar-content a:hover,
80
+ .sidebar-content ul ul summary:hover {
81
+ background: var(--apple-fill-secondary);
82
+ color: var(--apple-foreground);
73
83
  }
74
- .sidebar-content a:focus-visible {
84
+ .sidebar-content a[aria-current="page"],
85
+ .sidebar-content a[aria-current="page"]:is(:hover, :focus) {
86
+ background: var(--apple-fill);
87
+ color: var(--apple-foreground);
88
+ font-weight: 600;
89
+ }
90
+ .sidebar-content :is(a, summary):focus-visible {
75
91
  outline-offset: -2px;
76
92
  }
77
- .sidebar-content a[aria-current="page"] {
78
- background: var(--apple-active-surface);
79
- color: var(--apple-link);
80
- font-weight: 500;
93
+
94
+ .sidebar-content .sl-badge {
95
+ margin-inline-start: auto;
81
96
  }
82
- .sidebar-content a[aria-current="page"]:is(:hover, :focus-visible) {
83
- background: var(--apple-active-surface);
84
- color: var(--apple-link);
97
+
98
+ @media (max-width: 49.99rem) {
99
+ .sidebar-content {
100
+ padding-inline: 1rem;
101
+ }
102
+ .sidebar-content :is(a, summary) {
103
+ min-height: 2.75rem;
104
+ font-size: 1.0625rem;
105
+ }
85
106
  }
package/styles/toc.css CHANGED
@@ -1,78 +1,85 @@
1
+ /* “On this page”: a quiet rail with a single accent marker on the active section. */
1
2
  .right-sidebar {
2
- width: var(--apple-toc-width);
3
3
  border-inline-start: 0;
4
- background: transparent;
4
+ background: var(--apple-background);
5
+ scrollbar-width: none;
5
6
  }
6
7
  .right-sidebar-panel {
7
- padding-top: 2.5rem;
8
+ padding: 2.5rem 1.25rem 2rem 0.5rem;
8
9
  }
9
10
  .right-sidebar-panel .sl-container {
11
+ width: auto;
10
12
  max-width: none;
11
13
  }
12
- .right-sidebar h2 {
13
- margin-bottom: 0.625rem;
14
+
15
+ starlight-toc h2 {
16
+ margin-bottom: 0.75rem;
14
17
  color: var(--apple-foreground);
15
- font-size: 0.75rem;
18
+ font-size: 0.8125rem;
16
19
  font-weight: 600;
17
- line-height: 1rem;
18
- letter-spacing: 0.01em;
19
- }
20
- .right-sidebar ul {
21
- border-inline-start: 0;
22
- }
23
- .right-sidebar ul ul {
24
- padding-inline-start: 0.75rem;
20
+ line-height: 1.125rem;
21
+ letter-spacing: -0.008em;
25
22
  }
26
- .right-sidebar a {
27
- margin-block: 0;
28
- padding: 0.25rem 0.75rem;
23
+ starlight-toc nav > ul {
29
24
  border-inline-start: 1px solid var(--apple-hairline);
25
+ }
26
+ starlight-toc a {
27
+ margin-inline-start: -1px;
28
+ padding-block: 0.3125rem;
29
+ padding-inline: calc(0.75rem * var(--depth) + 0.875rem) 0;
30
+ border-radius: 0;
31
+ border-inline-start: 2px solid transparent;
30
32
  color: var(--apple-secondary-foreground);
31
- font-size: 0.875rem;
33
+ font-size: 0.8125rem;
32
34
  line-height: 1.125rem;
35
+ letter-spacing: -0.008em;
36
+ text-decoration: none;
33
37
  overflow-wrap: anywhere;
34
38
  }
35
- .right-sidebar a span {
36
- white-space: normal;
37
- }
38
- .right-sidebar a:hover {
39
- color: var(--apple-link);
40
- }
41
- .right-sidebar a:focus-visible {
42
- border-radius: 2px;
43
- color: var(--apple-link);
44
- outline-offset: 2px;
39
+ starlight-toc a:hover {
40
+ color: var(--apple-foreground);
45
41
  }
46
- .right-sidebar a[aria-current="true"] {
42
+ starlight-toc a[aria-current="true"] {
47
43
  border-inline-start-color: var(--apple-link);
48
- color: var(--apple-link);
49
- font-weight: 500;
44
+ color: var(--apple-foreground);
45
+ font-weight: 600;
46
+ }
47
+ starlight-toc a:focus-visible {
48
+ outline-offset: -2px;
50
49
  }
51
50
 
52
- mobile-starlight-toc > nav {
53
- border-block: 1px solid var(--apple-hairline);
54
- background: var(--apple-header-background);
55
- -webkit-backdrop-filter: saturate(180%) blur(20px);
56
- backdrop-filter: saturate(180%) blur(20px);
51
+ /* Narrow layouts: Starlight’s collapsible “On this page” bar under the header. */
52
+ mobile-starlight-toc nav {
53
+ border-bottom: 1px solid var(--apple-hairline);
54
+ background: var(--apple-background);
57
55
  }
58
56
  mobile-starlight-toc summary {
59
57
  color: var(--apple-secondary-foreground);
60
58
  font-size: 0.8125rem;
61
59
  }
62
60
  mobile-starlight-toc .toggle {
63
- min-height: 2.25rem;
64
- border-color: transparent;
65
- border-radius: var(--apple-radius-sm);
66
- background: transparent;
61
+ border: 0;
62
+ border-radius: 980px;
63
+ background: var(--apple-fill-secondary);
64
+ color: var(--apple-foreground);
67
65
  }
68
66
  mobile-starlight-toc details[open] .toggle,
69
67
  mobile-starlight-toc .toggle:hover {
70
- border-color: transparent;
71
- background: var(--apple-active-surface);
68
+ border: 0;
69
+ background: var(--apple-fill);
70
+ color: var(--apple-foreground);
71
+ }
72
+ mobile-starlight-toc .display-current {
72
73
  color: var(--apple-foreground);
73
74
  }
74
75
  mobile-starlight-toc .dropdown {
75
- border-color: var(--apple-hairline);
76
+ border: 1px solid var(--apple-hairline);
77
+ border-radius: 0 0 var(--apple-radius-panel) var(--apple-radius-panel);
76
78
  background: var(--apple-background);
77
- box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
79
+ box-shadow: var(--sl-shadow-lg);
80
+ }
81
+ mobile-starlight-toc .dropdown a {
82
+ border-color: var(--apple-hairline);
83
+ color: var(--apple-foreground);
84
+ overflow-wrap: anywhere;
78
85
  }