starlight-theme-apple 0.1.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/CHANGELOG.md ADDED
@@ -0,0 +1,101 @@
1
+ # starlight-theme-apple
2
+
3
+ ## 0.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#65](https://github.com/acsandmann/starlight-theme-apple/pull/65) [`84b4096`](https://github.com/acsandmann/starlight-theme-apple/commit/84b4096452bed89126f4e48f8b11c433240c0848) Thanks [@trueberryless](https://github.com/trueberryless)! - Adds support for Astro v6, drops support for Astro v5.
8
+
9
+ ⚠️ **BREAKING CHANGE:** The minimum supported version of Starlight is now `0.38.0`.
10
+
11
+ Please follow the [upgrade guide](https://github.com/withastro/starlight/releases/tag/%40astrojs%2Fstarlight%400.38.0) to update your project.
12
+
13
+ ## 0.3.3
14
+
15
+ ### Patch Changes
16
+
17
+ - [#51](https://github.com/acsandmann/starlight-theme-apple/pull/51) [`179c35a`](https://github.com/acsandmann/starlight-theme-apple/commit/179c35aefdd6acd51bce638941379f3e5e427c58) Thanks [@acsandmann](https://github.com/apps/acsandmann)! - Setups trusted publishing using OpenID Connect (OIDC) authentication — no code changes.
18
+
19
+ ## 0.3.2
20
+
21
+ ### Patch Changes
22
+
23
+ - [`8262f4c`](https://github.com/acsandmann/starlight-theme-apple/commit/8262f4c71734fcfcbf522117b527c194c5a6ffbd) Thanks [@trueberryless](https://github.com/trueberryless)! - Make mobile toc even more little by decreasing the height to 3.5rem
24
+
25
+ ## 0.3.1
26
+
27
+ ### Patch Changes
28
+
29
+ - [`15a98fd`](https://github.com/acsandmann/starlight-theme-apple/commit/15a98fdc78175895f2d74d3aa9b91b345df7dfbc) Thanks [@trueberryless](https://github.com/trueberryless) and [@tsavpyn](https://github.com/tsavpyn)! - Fix mobile table of contents takes up too much space
30
+
31
+ ## 0.3.0
32
+
33
+ ### Minor Changes
34
+
35
+ - [`e0537f3`](https://github.com/acsandmann/starlight-theme-apple/commit/e0537f3dd70c8ad5d4702cc5059060c64a5ff05f) Thanks [@trueberryless](https://github.com/trueberryless)! - Rename NPM package to starlight-theme-apple
36
+
37
+ ### Patch Changes
38
+
39
+ - [`9f032da`](https://github.com/acsandmann/starlight-theme-apple/commit/9f032da50ff24c37b48eaa1c0060439ebfbedab7) Thanks [@trueberryless](https://github.com/trueberryless)! - Make pagination labels and arrows more subtle and adjust margins and sizes
40
+
41
+ - [`24cd5c2`](https://github.com/acsandmann/starlight-theme-apple/commit/24cd5c229370fd5c056593f25be6c98c118f9c45) Thanks [@trueberryless](https://github.com/trueberryless)! - Fix spacing between social icons when screen width is between 800px and 1151px
42
+
43
+ ## 0.2.1
44
+
45
+ ### Patch Changes
46
+
47
+ - [`fa2e281`](https://github.com/acsandmann/starlight-theme-apple/commit/fa2e28104b334a8a15626deea8fa1006def9cc11) Thanks [@trueberryless](https://github.com/trueberryless)! - Improve the accessibility of the Table of Contents by highlighting the active heading with the accent color.
48
+
49
+ ## 0.2.0
50
+
51
+ ### Minor Changes
52
+
53
+ - [#14](https://github.com/acsandmann/starlight-theme-apple/pull/14) [`623d0c7`](https://github.com/acsandmann/starlight-theme-apple/commit/623d0c7e561bf53c5c3dc9d932e59a605245a7aa) Thanks [@trueberryless](https://github.com/trueberryless)! - Groups all of the Starlight Next.js theme CSS declarations into a single `nextjs` [cascade layer](https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Styling_basics/Cascade_layers).
54
+
55
+ This change aligns with the Starlight CSS architecture and allows for easier customization of the Starlight Next.js theme CSS as any custom unlayered CSS will override the default styles. If you are using cascade layers in your custom CSS, you can use the [`@layer`](https://developer.mozilla.org/en-US/docs/Web/CSS/@layer) CSS at-rule to define the order of precedence for different layers including the ones used by Starlight and the Starlight Next.js theme.
56
+
57
+ Make sure to check your site’s appearance when upgrading to make sure there are no style regressions caused by this change.
58
+
59
+ - [#14](https://github.com/acsandmann/starlight-theme-apple/pull/14) [`623d0c7`](https://github.com/acsandmann/starlight-theme-apple/commit/623d0c7e561bf53c5c3dc9d932e59a605245a7aa) Thanks [@trueberryless](https://github.com/trueberryless)! - ⚠️ **BREAKING CHANGE:** The minimum supported version of Starlight is now version `0.34.0`.
60
+
61
+ Please use the `@astrojs/upgrade` command to upgrade your project:
62
+
63
+ ```sh
64
+ npx @astrojs/upgrade
65
+ ```
66
+
67
+ ### Patch Changes
68
+
69
+ - [#14](https://github.com/acsandmann/starlight-theme-apple/pull/14) [`4a3ba25`](https://github.com/acsandmann/starlight-theme-apple/commit/4a3ba257a0f60652fe7eaa049d2dc800cfee7b90) Thanks [@trueberryless](https://github.com/trueberryless)! - Fixes a banner position issue when using a banner in pages with a sidebar.
70
+
71
+ - [#14](https://github.com/acsandmann/starlight-theme-apple/pull/14) [`39abcc1`](https://github.com/acsandmann/starlight-theme-apple/commit/39abcc1f2310f42e4417891453e703a70ae517e7) Thanks [@trueberryless](https://github.com/trueberryless)! - Fixes an issue where nested user-defined Expressive Code settings were not being applied correctly.
72
+
73
+ ## 0.1.4
74
+
75
+ ### Patch Changes
76
+
77
+ - [`ba3a9df`](https://github.com/acsandmann/starlight-theme-apple/commit/ba3a9df11896b701dab098f3b3dfb85808f94c71) Thanks [@trueberryless](https://github.com/trueberryless)! - Fix width of banner being too large when ToC is not visible
78
+
79
+ ## 0.1.3
80
+
81
+ ### Patch Changes
82
+
83
+ - [#9](https://github.com/acsandmann/starlight-theme-apple/pull/9) [`65eb62a`](https://github.com/acsandmann/starlight-theme-apple/commit/65eb62a9587e9eeabe85e5f9cbfde2360590eef2) Thanks [@trueberryless](https://github.com/trueberryless)! - Fix margin between social icons, make whitespace between sidebar and content bigger
84
+
85
+ ## 0.1.2
86
+
87
+ ### Patch Changes
88
+
89
+ - [#4](https://github.com/acsandmann/starlight-theme-apple/pull/4) [`479a7dc`](https://github.com/acsandmann/starlight-theme-apple/commit/479a7dc28391670e701d4baa23ddadc472bf0624) Thanks [@trueberryless](https://github.com/trueberryless)! - Add keywords and lower peerDep to Starlight 0.30 because it's just CSS
90
+
91
+ ## 0.1.1
92
+
93
+ ### Patch Changes
94
+
95
+ - [`0ef41c9`](https://github.com/acsandmann/starlight-theme-apple/commit/0ef41c9ce7fcbe8aa101cc5bcfba4dbab11b037b) Thanks [@trueberryless](https://github.com/trueberryless)! - Fix @fontsource installed in root package
96
+
97
+ ## 0.1.0
98
+
99
+ ### Minor Changes
100
+
101
+ - [`ee9ce1e`](https://github.com/acsandmann/starlight-theme-apple/commit/ee9ce1ef4fec571f1ce7fa6c288baa5b68a23760) Thanks [@trueberryless](https://github.com/trueberryless)! - Initial public release
package/README.md ADDED
@@ -0,0 +1,15 @@
1
+ # `starlight-theme-apple`
2
+
3
+ An Astro Starlight theme inspired by Apple Developer Documentation.
4
+
5
+ ## Documentation
6
+
7
+ Want to get started immediately?
8
+
9
+ Check out the `starlight-theme-apple` getting started guide.
10
+
11
+ ## License
12
+
13
+ Licensed under the MIT license, Copyright © trueberryless.
14
+
15
+ See [LICENSE](https://github.com/acsandmann/starlight-theme-apple/blob/main/LICENSE) for more information.
@@ -0,0 +1,24 @@
1
+ ---
2
+ const title = Astro.locals.starlightRoute.entry.data.title;
3
+ const segments = Astro.url.pathname.split("/").filter(Boolean);
4
+ const parents = segments.slice(0, -1).map((segment, index) => ({
5
+ href: `/${segments.slice(0, index + 1).join("/")}/`,
6
+ label: decodeURIComponent(segment)
7
+ .split("-")
8
+ .map((word) => word.charAt(0).toUpperCase() + word.slice(1))
9
+ .join(" "),
10
+ }));
11
+ ---
12
+
13
+ <nav class="apple-breadcrumbs" aria-label="Breadcrumb">
14
+ <a href="/">Documentation</a>
15
+ {
16
+ parents.map((parent) => (
17
+ <>
18
+ <span aria-hidden="true">›</span>
19
+ <a href={parent.href}>{parent.label}</a>
20
+ </>
21
+ ))
22
+ }
23
+ </nav>
24
+ <h1 id="_top">{title}</h1>
package/index.ts ADDED
@@ -0,0 +1,49 @@
1
+ import type { StarlightPlugin } from "@astrojs/starlight/types";
2
+ import { fileURLToPath } from "node:url";
3
+
4
+ export default function starlightThemeApple(): StarlightPlugin {
5
+ return {
6
+ name: "starlight-theme-apple",
7
+ hooks: {
8
+ "config:setup"({ config, updateConfig }) {
9
+ const userExpressiveCodeConfig =
10
+ !config.expressiveCode || config.expressiveCode === true
11
+ ? {}
12
+ : config.expressiveCode;
13
+
14
+ updateConfig({
15
+ components: {
16
+ ...config.components,
17
+ PageTitle: fileURLToPath(
18
+ new URL("./components/PageTitle.astro", import.meta.url)
19
+ ),
20
+ },
21
+ customCss: [
22
+ ...(config.customCss ?? []),
23
+ "starlight-theme-apple/styles.css",
24
+ ],
25
+ expressiveCode:
26
+ config.expressiveCode === false
27
+ ? false
28
+ : {
29
+ themes: ["github-dark", "github-light"],
30
+ ...userExpressiveCodeConfig,
31
+ styleOverrides: {
32
+ borderColor: "var(--apple-border-subtle)",
33
+ borderRadius: "var(--apple-radius-sm)",
34
+ ...userExpressiveCodeConfig.styleOverrides,
35
+ frames: {
36
+ editorActiveTabIndicatorTopColor: "unset",
37
+ editorActiveTabIndicatorBottomColor: "var(--apple-link)",
38
+ editorTabBarBorderBottomColor:
39
+ "var(--apple-border-subtle)",
40
+ frameBoxShadowCssValue: "unset",
41
+ ...userExpressiveCodeConfig.styleOverrides?.frames,
42
+ },
43
+ },
44
+ },
45
+ });
46
+ },
47
+ },
48
+ };
49
+ }
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "starlight-theme-apple",
3
+ "version": "0.1.0",
4
+ "description": "An Apple Developer Documentation-inspired theme for Astro Starlight.",
5
+ "keywords": [
6
+ "starlight",
7
+ "theme",
8
+ "apple-developer-documentation",
9
+ "docs",
10
+ "black",
11
+ "dark"
12
+ ],
13
+ "homepage": "https://acsandmann.github.io/starlight-theme-apple/",
14
+ "bugs": {
15
+ "url": "https://github.com/acsandmann/starlight-theme-apple/issues"
16
+ },
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/acsandmann/starlight-theme-apple.git",
20
+ "directory": "packages/starlight-theme-apple"
21
+ },
22
+ "license": "MIT",
23
+ "author": "trueberryless <trueberryless@gmail.com> (https://felixs.dev)",
24
+ "type": "module",
25
+ "exports": {
26
+ ".": "./index.ts",
27
+ "./styles.css": "./styles.css",
28
+ "./styles/*": "./styles/*"
29
+ },
30
+ "devDependencies": {
31
+ "@astrojs/starlight": "^0.41.7",
32
+ "astro": "^7.0.2"
33
+ },
34
+ "peerDependencies": {
35
+ "@astrojs/starlight": ">=0.38"
36
+ },
37
+ "engines": {
38
+ "node": ">=22.23.2"
39
+ },
40
+ "publishConfig": {
41
+ "access": "public"
42
+ }
43
+ }
@@ -0,0 +1,104 @@
1
+ html {
2
+ scroll-padding-top: calc(var(--apple-header-height) + 1.5rem);
3
+ text-rendering: optimizeLegibility;
4
+ }
5
+ body {
6
+ background: var(--apple-background);
7
+ color: var(--apple-foreground);
8
+ font-family: var(--apple-font-sans);
9
+ font-size: 1.0625rem;
10
+ line-height: 1.4706;
11
+ -webkit-font-smoothing: antialiased;
12
+ -moz-osx-font-smoothing: grayscale;
13
+ }
14
+ ::selection {
15
+ background: color-mix(in srgb, var(--apple-link) 28%, transparent);
16
+ }
17
+ :focus-visible {
18
+ outline: 2px solid var(--apple-link);
19
+ outline-offset: 3px;
20
+ }
21
+ a {
22
+ transition:
23
+ color var(--apple-transition),
24
+ background-color var(--apple-transition),
25
+ border-color var(--apple-transition);
26
+ }
27
+ button,
28
+ [role="button"],
29
+ summary,
30
+ input,
31
+ select {
32
+ transition:
33
+ color var(--apple-transition),
34
+ background-color var(--apple-transition),
35
+ border-color var(--apple-transition),
36
+ box-shadow var(--apple-transition),
37
+ opacity var(--apple-transition),
38
+ transform 80ms ease;
39
+ }
40
+ button:active:not(:disabled),
41
+ [role="button"]:active:not([aria-disabled="true"]) {
42
+ transform: scale(0.97);
43
+ }
44
+ :is(button, input, select, summary, a)[aria-disabled="true"],
45
+ button:disabled,
46
+ input:disabled,
47
+ select:disabled {
48
+ cursor: not-allowed;
49
+ opacity: var(--apple-disabled-opacity);
50
+ }
51
+ .main-frame {
52
+ background: var(--apple-background);
53
+ }
54
+ .main-pane {
55
+ min-width: 0;
56
+ }
57
+ .main-pane main {
58
+ position: relative;
59
+ }
60
+ .content-panel {
61
+ padding-block: 0;
62
+ }
63
+ .content-panel + .content-panel,
64
+ .main-pane > main > .content-panel:last-of-type {
65
+ border-top: 0;
66
+ }
67
+ .sl-container {
68
+ max-width: var(--apple-content-width);
69
+ }
70
+ .sl-banner {
71
+ max-width: var(--apple-content-width);
72
+ margin-block: 2rem 1rem;
73
+ margin-inline: var(--sl-content-pad-x);
74
+ padding: 0.875rem 1rem;
75
+ border: 1px solid var(--apple-border);
76
+ border-radius: var(--apple-radius-sm);
77
+ background: var(--apple-surface);
78
+ box-shadow: none;
79
+ color: var(--apple-foreground);
80
+ text-align: start;
81
+ }
82
+ .sl-banner a {
83
+ color: var(--apple-link);
84
+ }
85
+ [data-has-sidebar] main:has(.sl-banner) {
86
+ display: grid;
87
+ }
88
+ @media (min-width: 72rem) {
89
+ .sl-banner {
90
+ margin-inline: auto;
91
+ }
92
+ [data-has-sidebar] .sl-banner {
93
+ justify-self: end;
94
+ margin-inline: var(--sl-content-pad-x);
95
+ }
96
+ }
97
+ @media (prefers-reduced-motion: reduce) {
98
+ *,
99
+ *::before,
100
+ *::after {
101
+ scroll-behavior: auto !important;
102
+ transition-duration: 0.01ms !important;
103
+ }
104
+ }
@@ -0,0 +1,77 @@
1
+ .sl-markdown-content :not(pre) > code:not(:where(.not-content *)) {
2
+ padding: 0.12em 0.32em;
3
+ border: 1px solid var(--apple-border-subtle);
4
+ border-radius: 0.22rem;
5
+ background: var(--apple-code-background);
6
+ color: var(--apple-foreground);
7
+ font-family: var(--apple-font-mono);
8
+ font-size: 0.88em;
9
+ }
10
+ .expressive-code {
11
+ --ec-brdRad: var(--apple-radius-sm);
12
+ --ec-brdWd: 1px;
13
+ margin-block: 1.5rem;
14
+ }
15
+ .expressive-code figure.frame {
16
+ box-shadow: none !important;
17
+ }
18
+ .sl-markdown-content .expressive-code .has-title {
19
+ --ec-uiPadBlk: 0.375rem;
20
+ }
21
+ .expressive-code .frame .header {
22
+ min-height: 2.2rem;
23
+ border-color: var(--apple-border-subtle) !important;
24
+ background: var(--apple-code-background) !important;
25
+ }
26
+ .sl-markdown-content .expressive-code .frame.is-terminal .header {
27
+ border-bottom: 1px solid var(--apple-border) !important;
28
+ }
29
+ .expressive-code .frame .title {
30
+ color: var(--apple-secondary-foreground) !important;
31
+ font-family: var(--apple-font-sans) !important;
32
+ font-size: 0.875rem !important;
33
+ font-weight: 500 !important;
34
+ }
35
+ .expressive-code pre {
36
+ border-color: var(--apple-border-subtle) !important;
37
+ background: var(--apple-code-background) !important;
38
+ }
39
+ .expressive-code pre code {
40
+ font-size: 0.9375rem !important;
41
+ line-height: 1.5625rem !important;
42
+ }
43
+ .expressive-code .copy button {
44
+ border-color: var(--apple-border) !important;
45
+ border-radius: var(--apple-radius-sm) !important;
46
+ background: var(--apple-surface-raised) !important;
47
+ color: var(--apple-secondary-foreground) !important;
48
+ }
49
+ .expressive-code .copy button:hover {
50
+ border-color: var(--apple-link) !important;
51
+ background: var(--apple-selection) !important;
52
+ color: var(--apple-link) !important;
53
+ }
54
+ .expressive-code .copy button:active,
55
+ .expressive-code .copy button[data-copied] {
56
+ background: var(--apple-pressed) !important;
57
+ color: var(--apple-foreground) !important;
58
+ }
59
+ .sl-markdown-content starlight-file-tree {
60
+ border: 1px solid var(--apple-border-subtle);
61
+ border-radius: var(--apple-radius-sm);
62
+ background: var(--apple-code-background);
63
+ }
64
+ .sl-markdown-content
65
+ starlight-file-tree
66
+ .directory
67
+ > details
68
+ > summary:hover
69
+ ~ ul,
70
+ .sl-markdown-content
71
+ starlight-file-tree
72
+ .directory
73
+ > details
74
+ > summary:focus-visible
75
+ ~ ul {
76
+ border-color: var(--apple-link);
77
+ }