Skip to content

Commit 6a64022

Browse files
docs: fix header and tabs on docs pages
1. Header: on docs pages, use the theme's standard header (text title + search) instead of the branded logo header. The homepage keeps the logo + 'Docs' link + GitHub icon. Removed replacesTitle so docs pages show 'Sentry CLI' as text, not the logo SVG. 2. Tabs: updated PackageManagerCode tabs from underline-style to the theme's pill-style (rounded, purple accent background on active tab) to match Starlight tab styling from @sentry/starlight-theme.
1 parent ebadf59 commit 6a64022

3 files changed

Lines changed: 46 additions & 46 deletions

File tree

docs/astro.config.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export default defineConfig({
4949
favicon: "/favicon.png",
5050
logo: {
5151
src: "./src/assets/logo.svg",
52-
replacesTitle: true,
5352
},
5453
social: [
5554
{

docs/src/components/Header.astro

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,55 @@
11
---
22
/**
3-
* CLI-specific Header — extends the shared theme's Header pattern
4-
* with homepage detection, "Docs" nav link, and social icons.
3+
* CLI-specific Header — conditionally renders:
4+
* - Homepage: branded header with logo, "Docs" link, social icons, no search
5+
* - Docs pages: theme's standard header with search (no logo)
56
*/
67
import config from "virtual:starlight/user-config";
78
9+
import LanguageSelect from "virtual:starlight/components/LanguageSelect";
810
import Search from "virtual:starlight/components/Search";
911
import SiteTitle from "virtual:starlight/components/SiteTitle";
1012
import SocialIcons from "virtual:starlight/components/SocialIcons";
13+
import ThemeSelect from "virtual:starlight/components/ThemeSelect";
1114
1215
const shouldRenderSearch =
1316
config.pagefind ||
1417
config.components.Search !== "@astrojs/starlight/components/Search.astro";
1518
16-
// Detect homepage (splash page). In Starlight >=0.33, route data lives on
17-
// Astro.locals.starlightRoute; the old `slug` field is now `id`.
1819
const isHomepage = Astro.locals.starlightRoute.id === "";
1920
20-
// Get base path for links
2121
const baseUrl = import.meta.env.BASE_URL;
2222
const base = baseUrl.endsWith("/") ? baseUrl : baseUrl + "/";
2323
---
2424

25-
<div class:list={["header sentry-header", { "header-homepage": isHomepage }]}>
26-
<div class="title-wrapper sl-flex">
27-
<SiteTitle />
28-
</div>
29-
<div class="sentry-header-actions sl-flex print:hidden">
30-
{!isHomepage && shouldRenderSearch && <Search />}
31-
{isHomepage && (
25+
{isHomepage ? (
26+
<!-- Homepage: branded header -->
27+
<div class="header sentry-header header-homepage">
28+
<div class="title-wrapper sl-flex">
29+
<SiteTitle />
30+
</div>
31+
<div class="sentry-header-actions sl-flex print:hidden">
3232
<a href={`${base}getting-started/`} class="header-nav-link">Docs</a>
33-
)}
34-
{!isHomepage && <span class="header-nav-link header-nav-active">Docs</span>}
35-
<div class="sl-hidden md:sl-flex sentry-header-secondary">
36-
<SocialIcons />
33+
<div class="sl-hidden md:sl-flex sentry-header-secondary">
34+
<SocialIcons />
35+
</div>
36+
</div>
37+
</div>
38+
) : (
39+
<!-- Docs pages: theme's standard header with search -->
40+
<div class="header sentry-header">
41+
<div class="title-wrapper sl-flex">
42+
<SiteTitle />
43+
</div>
44+
<div class="sentry-header-actions sl-flex print:hidden">
45+
{shouldRenderSearch && <Search />}
46+
<div class="sl-hidden md:sl-flex sentry-header-secondary">
47+
<ThemeSelect />
48+
<LanguageSelect />
49+
</div>
3750
</div>
3851
</div>
39-
</div>
52+
)}
4053

4154
<style>
4255
.header-homepage {
@@ -60,13 +73,4 @@ const base = baseUrl.endsWith("/") ? baseUrl : baseUrl + "/";
6073
opacity: 1;
6174
background: rgba(255, 255, 255, 0.1);
6275
}
63-
64-
.header-nav-active {
65-
opacity: 1;
66-
cursor: default;
67-
}
68-
69-
.header-nav-active:hover {
70-
background: none;
71-
}
7276
</style>

docs/src/components/PackageManagerCode.astro

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -51,39 +51,36 @@ const id = `pm-${Math.random().toString(36).substr(2, 9)}`;
5151
}
5252

5353
.pm-tabs {
54-
display: flex;
55-
align-items: baseline;
54+
display: inline-flex;
55+
gap: 0.15rem;
56+
border-radius: 8px;
57+
background: rgba(255, 255, 255, 0.045);
58+
padding: 0.18rem;
5659
}
5760

5861
.pm-tab {
59-
padding: 0.35rem 0.75rem;
60-
font-size: 0.8rem;
62+
padding: 0.34rem 0.72rem;
63+
font-size: 0.82rem;
6164
font-weight: 500;
62-
color: rgba(255, 255, 255, 0.4);
65+
color: var(--ve-text-tertiary, rgba(255, 255, 255, 0.4));
6366
background: none;
6467
border: none;
68+
border-radius: 6px;
6569
cursor: pointer;
66-
transition: color 0.15s ease;
70+
transition: background 120ms ease, color 120ms ease;
6771
font-family: inherit;
68-
position: relative;
72+
line-height: 1.25;
6973
}
7074

7175
.pm-tab:hover {
72-
color: rgba(255, 255, 255, 0.7);
76+
background: rgba(255, 255, 255, 0.055);
77+
color: var(--ve-text-secondary, rgba(255, 255, 255, 0.7));
7378
}
7479

7580
.pm-tab.active {
76-
color: #fff;
77-
}
78-
79-
.pm-tab.active::after {
80-
content: '';
81-
position: absolute;
82-
left: 0.75rem;
83-
right: 0.75rem;
84-
bottom: 0;
85-
height: 2px;
86-
background: #fff;
81+
background: var(--ve-accent-soft, rgba(139, 92, 246, 0.2));
82+
color: var(--ve-text, #fafafa);
83+
font-weight: 650;
8784
}
8885

8986
.pm-copy {

0 commit comments

Comments
 (0)