Skip to content

Commit 2a7ae73

Browse files
rcastleycursoragent
andcommitted
fix(nav): style browse menu entry as destination pill
Keep the Browse nav item visually distinct from utility icon buttons by adding a dedicated class path in the header partial and matching pill styles in layout CSS. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent bf311be commit 2a7ae73

2 files changed

Lines changed: 35 additions & 1 deletion

File tree

assets/css/layout.css

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,31 @@
110110
background: var(--gradient-accent);
111111
}
112112

113+
/* Browse menu entry is a destination pill (not a utility icon button). */
114+
.nav__link--browse {
115+
display: inline-flex;
116+
align-items: center;
117+
height: 2.25rem;
118+
padding: 0 0.95rem;
119+
border: 1px solid var(--color-border-strong);
120+
border-radius: 999px;
121+
color: var(--color-ink);
122+
font-weight: 600;
123+
line-height: 1;
124+
}
125+
.nav__link--browse:hover {
126+
color: var(--color-accent-text);
127+
border-color: var(--color-accent);
128+
}
129+
.nav__link--browse.is-active::after {
130+
content: none;
131+
}
132+
.nav__link--browse.is-active {
133+
color: var(--color-accent-text);
134+
border-color: var(--color-accent);
135+
background: color-mix(in oklab, var(--color-accent) 8%, transparent);
136+
}
137+
113138
/* ---- Language switcher ---- */
114139
.lang-switch {
115140
position: relative;

layouts/_partials/chrome/header.html

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,23 @@
1717

1818
<nav class="nav" aria-label="Primary">
1919
{{- range site.Menus.main }}
20+
{{- $classes := slice "nav__link" -}}
21+
{{- if $.IsMenuCurrent "main" . -}}
22+
{{- $classes = $classes | append "is-active" -}}
23+
{{- end -}}
24+
{{- with .Page -}}
25+
{{- if eq .Layout "browse" -}}
26+
{{- $classes = $classes | append "nav__link--browse" -}}
27+
{{- end -}}
28+
{{- end -}}
2029
{{- /* Page-backed menu entries (added via `[menu.main]` in a page's
2130
front matter) report .URL as the page's RelPermalink, which
2231
is already an absolute path INCLUDING baseURL prefix and
2332
language subdir. Passing that through site-href would
2433
relLangURL it a second time and produce a doubled URL
2534
(`/repo/en/repo/en/foo/`). Use .Page.RelPermalink directly
2635
in that case and only run site-href on URL-only entries. */ -}}
27-
<a class="nav__link {{ if $.IsMenuCurrent "main" . }}is-active{{ end }}" href="{{ with .Page }}{{ .RelPermalink }}{{ else }}{{ partial "site-href.html" .URL }}{{ end }}">{{ .Name }}</a>
36+
<a class="{{ delimit $classes " " }}" href="{{ with .Page }}{{ .RelPermalink }}{{ else }}{{ partial "site-href.html" .URL }}{{ end }}">{{ .Name }}</a>
2837
{{- end }}
2938
<button class="site-search-trigger" type="button" data-search-trigger aria-label="{{ i18n "searchTrigger" }}" aria-haspopup="dialog">
3039
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>

0 commit comments

Comments
 (0)