Visitar URL original
fix(site): tidy the phone nav, docs menus and icons by iamdavidhill · Pull Request #62707 · anomalyco/opencode · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(data): match the GitHub mark and menu button to the other navs
  • Loading branch information
iamdavidhill committed Nov 8, 2026
commit 8ecde46ef242b82dbd551767e856a531bf316ec6
10 changes: 0 additions & 10 deletions packages/nav-menus/src/nav-menus.css
Original file line number Diff line number Diff line change
Expand Up @@ -212,16 +212,6 @@
width: 2px;
background: var(--bar);
}

[role="menuitem"][aria-current="page"]:is(:focus-visible, :active)::before {
background: var(--link);
}

@media (hover: hover) and (pointer: fine) {
[role="menuitem"][aria-current="page"]:hover::before {
background: var(--link);
}
}
}

[data-slot="meta"] {
Expand Down
126 changes: 89 additions & 37 deletions packages/stats/app/src/routes/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -261,17 +261,14 @@ body {
--github-focus: var(--stats-accent);
}

/* Phones: the rule is drawn inside the 56px bar, as opencode.ai's top bar does, and the menu button's centre is where
the site's is (its 32px box 6px further in than the site's 44px one). */
/* Phones: the rule is drawn inside the 56px bar, as opencode.ai's top bar does. The menu button and the GitHub mark
before it sit where the Console's and opencode.ai's do: the button's centre where the site's 44px button has it
(its 32px box 6px further in), the mark's 16px before it. */
@media (max-width: 60rem) {
[data-page="stats"] [data-slot="header-bar"] {
border-bottom: 0;
box-shadow: inset 0 -1px 0 var(--nav-rule);
}

[data-page="stats"] [data-slot="menu-button"] {
margin-inline-end: 6px;
}
}

[data-page="stats"] [data-component="top"] a {
Expand Down Expand Up @@ -321,8 +318,7 @@ body {
gap: 8px;
}

[data-page="stats"] [data-slot="header-button"],
[data-page="stats"] [data-slot="menu-button"] {
[data-page="stats"] [data-slot="header-button"] {
position: relative;
flex-shrink: 0;
display: inline-flex;
Expand All @@ -340,8 +336,7 @@ body {
cursor: pointer;
}

[data-page="stats"] [data-slot="header-button"]::before,
[data-page="stats"] [data-slot="menu-button"]::before {
[data-page="stats"] [data-slot="header-button"]::before {
position: absolute;
top: 0;
right: 0;
Expand All @@ -357,8 +352,7 @@ body {
}

[data-page="stats"] [data-slot="header-button"] strong,
[data-page="stats"] [data-slot="header-button"] span,
[data-page="stats"] [data-slot="menu-button"] svg {
[data-page="stats"] [data-slot="header-button"] span {
position: relative;
z-index: 1;
}
Expand All @@ -380,16 +374,93 @@ body {
inset 0 1px 2px 0 #ffffff24;
}

/* The menu button, as the Console's (packages/site in anomalyco/opencode-console, landing.css): no box, two lines that
meet in the middle and turn into a cross while the menu is open, and back. 32 × 28, with a 44px target. */
[data-page="stats"] [data-slot="menu-button"] {
position: relative;
flex-shrink: 0;
display: inline-flex;
align-items: center;
justify-content: center;
width: 32px;
height: 28px;
margin: 0;
padding: 0;
color: #3a3a3a;
background: #ffffff;
box-shadow:
0 0 0 0 #00000024,
0 0 0 0.5px #00000024,
0 1px 1.5px 0 #0000001a;
border: 0;
appearance: none;
background: none;
color: var(--stats-text);
cursor: pointer;
-webkit-tap-highlight-color: transparent;

&::after {
content: "";
position: absolute;
inset: -8px -6px;
}

@media (max-width: 60rem) {
margin-inline: 8px 6px;
}
}

[data-page="stats"] [data-slot="menu-lines"] {
position: relative;
width: 18px;
height: 8px;

&::before,
&::after {
content: "";
position: absolute;
left: 0;
width: 100%;
height: 1.5px;
border-radius: 1px;
background: currentColor;
transform-origin: 50% 50%;
/* Closing: the cross unrotates, then the lines part; the two overlap so it reads as one motion. */
transition:
rotate 0.22s cubic-bezier(0.4, 0, 0.2, 1),
translate 0.22s cubic-bezier(0.2, 0.8, 0.2, 1) 0.12s;
}

&::before {
top: 0;
}

&::after {
top: calc(100% - 1.5px);
}
}

/* Opening: the lines meet in the middle, then turn into a cross about their centre, overlapping slightly. */
[data-page="stats"] [data-slot="menu-button"][aria-expanded="true"] [data-slot="menu-lines"] {
&::before,
&::after {
transition:
translate 0.2s cubic-bezier(0.4, 0, 0.2, 1),
rotate 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) 0.12s;
}

&::before {
translate: 0 3.25px;
rotate: 45deg;
}

&::after {
translate: 0 -3.25px;
rotate: -45deg;
}
}

@media (prefers-reduced-motion: reduce) {
[data-page="stats"] [data-slot="menu-lines"] {
&::before,
&::after {
transition: none !important;
}
}
}

[data-page="stats"] [data-slot="header-button"]:focus-visible,
Expand Down Expand Up @@ -7407,16 +7478,6 @@ body {
background: #ffffff0d;
}

[data-page="stats"][data-theme="dark"] [data-slot="menu-button"],
:root[data-stats-theme="dark"] [data-page="stats"]:not([data-theme="light"]) [data-slot="menu-button"] {
color: #fafafa;
background: #ffffff0f;
box-shadow:
0 -0.5px 0 0 #ffffff33,
0 0 0 0.5px #ffffff33,
0 1px 2px 0 #00000066;
}

[data-page="stats"][data-theme="dark"] [data-slot="header-button"][data-variant="contrast"],
:root[data-stats-theme="dark"]
[data-page="stats"]:not([data-theme="light"])
Expand Down Expand Up @@ -7544,15 +7605,6 @@ body {
opacity: 0.78;
}

:root:not([data-stats-theme="light"]) [data-page="stats"]:not([data-theme="light"]) [data-slot="menu-button"] {
color: #fafafa;
background: #ffffff0f;
box-shadow:
0 -0.5px 0 0 #ffffff33,
0 0 0 0.5px #ffffff33,
0 1px 2px 0 #00000066;
}

:root:not([data-stats-theme="light"])
[data-page="stats"]:not([data-theme="light"])
[data-slot="header-button"][data-variant="contrast"] {
Expand Down
12 changes: 4 additions & 8 deletions packages/stats/app/src/routes/stats-shell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ export function Header(props: { githubStars: string; links?: readonly HeaderLink
</ul>
</nav>
<div data-slot="header-actions">
<a data-slot="header-button" data-variant="contrast" href="https://opencode.ai/">
<strong>{i18n.t("header.tryOpenCode")}</strong>
</a>
<a
data-slot="github-mark"
href={githubLink.href}
Expand All @@ -134,9 +137,6 @@ export function Header(props: { githubStars: string; links?: readonly HeaderLink
<path d="M8 0c4.42 0 8 3.58 8 8a8.013 8.013 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27-.68 0-1.36.09-2 .27-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8Z" />
</svg>
</a>
<a data-slot="header-button" data-variant="contrast" href="https://opencode.ai/">
<strong>{i18n.t("header.tryOpenCode")}</strong>
</a>
<button
data-slot="menu-button"
type="button"
Expand All @@ -145,11 +145,7 @@ export function Header(props: { githubStars: string; links?: readonly HeaderLink
aria-label={menuOpen() ? i18n.t("header.closeNav") : i18n.t("header.openNav")}
onClick={() => setMenuOpen((value) => !value)}
>
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true">
<Show when={menuOpen()} fallback={<path d="M2 4.72H14M2 8.5H14M2 12.28H14" stroke="currentColor" />}>
<path d="M4.44 4.44L11.56 11.56M11.56 4.44L4.44 11.56" stroke="currentColor" />
</Show>
</svg>
<span data-slot="menu-lines" aria-hidden="true" />
</button>
</div>
</div>
Expand Down