Skip to content

Commit c064547

Browse files
docs: migrate to @sentry/starlight-theme (#996)
## Summary Migrate the CLI docs site from a custom 1900-line dark theme to the shared `@sentry/starlight-theme` package. ## Changes ### Added - `@sentry/starlight-theme` — shared Starlight plugin with dark-only theme, component overrides (Header, Footer, ThemeSelect, Pagination), and monochrome code highlighting - `docs/src/styles/cli.css` — slim (~250 lines) of CLI-specific styles (splash page, feature sections, overscroll easter egg) ### Removed - `docs/src/styles/custom.css` — 1869 lines of custom dark theme CSS (now provided by the shared theme) - `docs/src/components/ThemeProvider.astro` — dark-mode forcing (theme handles this) - `docs/src/components/ThemeSelect.astro` — empty theme select (theme handles this) - `docs/src/components/Header.astro` — custom header (theme provides its own) - `docs/src/components/CodeBlock.astro` — unused - `docs/src/components/CommandBox.astro` — unused (imported but never rendered) - Custom `expressiveCode` config with `github-dark` theme ### Updated - `astro.config.mjs` — uses `sentryStarlightTheme()` plugin and `monochromeCodeTheme` - `@astrojs/starlight` bumped to `^0.39.2` (theme peer dependency) - `astro` bumped to `^6.3.5` - `InstallSelector.astro` — uses monochrome theme instead of `github-dark` for Shiki highlighting - Component font references updated from hardcoded `'JetBrains Mono'` to `var(--sl-font-mono)` - `PageTitle.astro` — uses theme design tokens (`--ve-*`) ### Kept (CLI-specific) - `InstallSelector`, `PackageManagerCode`, `Terminal`, `FeatureTerminal`, `FeatureVisual`, `PageTitle` components - Splash/landing page layout and feature section CSS - Overscroll easter egg - Google Fonts (Inter + JetBrains Mono) - Plausible analytics, OG images - `@sentry/astro` integration and sourcemap config ## Visual changes expected - Syntax highlighting switches from `github-dark` to monochrome (shared theme) - Header follows shared theme design (GitHub link moves to footer social links) - Sidebar, code blocks, tabs, and content styling follow shared theme defaults - Overall color palette is very similar (same `#0a0a0f` background, same `#8b5cf6` purple accent) ## Notes - The lockfile (`bun.lock`) needs regeneration after merging — run `cd docs && bun install` - Visual review of the PR preview is recommended, especially the landing page and command reference pages --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: Miguel Betegón <miguelbetegongarcia@gmail.com>
1 parent 33515c5 commit c064547

16 files changed

Lines changed: 779 additions & 2243 deletions

docs/astro.config.mjs

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import starlight from "@astrojs/starlight";
22
import sentry from "@sentry/astro";
3+
import sentryStarlightTheme, {
4+
monochromeCodeTheme,
5+
} from "@sentry/starlight-theme";
36
import { defineConfig } from "astro/config";
47

58
// Allow base path override via environment variable for PR previews
@@ -10,6 +13,9 @@ export default defineConfig({
1013
base,
1114
markdown: {
1215
smartypants: false,
16+
shikiConfig: {
17+
theme: monochromeCodeTheme,
18+
},
1319
},
1420
// Generate sourcemaps for Sentry. "hidden" produces .map files without
1521
// adding //# sourceMappingURL comments to the output (the debug IDs
@@ -52,28 +58,9 @@ export default defineConfig({
5258
href: "https://github.com/getsentry/cli",
5359
},
5460
],
55-
expressiveCode: {
56-
themes: ["github-dark"],
57-
styleOverrides: {
58-
frames: {
59-
frameBoxShadowCssValue: "none",
60-
editorActiveTabIndicatorTopColor: "transparent",
61-
editorActiveTabIndicatorBottomColor: "transparent",
62-
editorTabBarBorderBottomColor: "transparent",
63-
editorTabBarBackground: "transparent",
64-
terminalTitlebarBorderBottomColor: "transparent",
65-
terminalTitlebarBackground: "rgba(255, 255, 255, 0.03)",
66-
terminalBackground: "#0a0a0f",
67-
},
68-
borderRadius: "12px",
69-
borderColor: "rgba(255, 255, 255, 0.1)",
70-
codeBackground: "#0a0a0f",
71-
},
72-
},
61+
plugins: [sentryStarlightTheme()],
7362
components: {
74-
ThemeProvider: "./src/components/ThemeProvider.astro",
7563
Header: "./src/components/Header.astro",
76-
ThemeSelect: "./src/components/ThemeSelect.astro",
7764
PageTitle: "./src/components/PageTitle.astro",
7865
},
7966
head: [
@@ -91,7 +78,7 @@ export default defineConfig({
9178
const path = window.location.pathname;
9279
// Works with both / (prod) and /pr-preview/pr-XX (preview)
9380
return path === '/' ||
94-
/^\\/_preview\\/pr-(\\d+|main)\\/?$/.test(path);
81+
/^\\/\\_preview\\/pr-(\\d+|main)\\/?$/.test(path);
9582
}
9683
9784
function checkAtBottom() {
@@ -235,7 +222,7 @@ export default defineConfig({
235222
},
236223
{
237224
label: "Commands",
238-
autogenerate: { directory: "commands" },
225+
items: [{ autogenerate: { directory: "commands" } }],
239226
},
240227
{
241228
label: "Resources",
@@ -245,7 +232,7 @@ export default defineConfig({
245232
],
246233
},
247234
],
248-
customCss: ["./src/styles/custom.css"],
235+
customCss: ["./src/styles/cli.css"],
249236
}),
250237
],
251238
});

docs/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
"preview": "astro preview"
99
},
1010
"dependencies": {
11-
"@astrojs/starlight": "^0.38.3",
11+
"@astrojs/starlight": "^0.39.2",
1212
"@sentry/astro": "^10.38.0",
13-
"astro": "^6.1.8",
13+
"@sentry/starlight-theme": "^0.3.0",
14+
"astro": "^6.3.5",
1415
"sharp": "^0.33.5",
1516
"shiki": "^3.21.0"
1617
}

0 commit comments

Comments
 (0)