Skip to content

Commit da8c021

Browse files
authored
fix(site): tidy the phone nav, docs menus and icons (#62707)
1 parent 10bc5cb commit da8c021

36 files changed

Lines changed: 375 additions & 140 deletions

‎packages/nav-menus/src/index.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ export function addProductToggles() {
468468
chevron.setAttribute("aria-haspopup", "menu")
469469
chevron.setAttribute("aria-expanded", "false")
470470
chevron.setAttribute("aria-label", "OpenCode products")
471-
chevron.innerHTML = `<svg width="10" height="10" viewBox="0 0 12 12" fill="none" aria-hidden="true"><path d="M3 4.5L6 7.5L9 4.5" stroke="currentColor" stroke-width="1.5"/></svg>`
471+
chevron.innerHTML = `<svg width="10" height="10" viewBox="0 0 12 12" fill="none" aria-hidden="true"><path d="M3 4.5L6 7.5L9 4.5" stroke="currentColor" stroke-width="1.5" vector-effect="non-scaling-stroke"/></svg>`
472472
name.after(chevron)
473473
})
474474
}

‎packages/nav-menus/src/nav-menus.css‎

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -212,16 +212,6 @@
212212
width: 2px;
213213
background: var(--bar);
214214
}
215-
216-
[role="menuitem"][aria-current="page"]:is(:focus-visible, :active)::before {
217-
background: var(--link);
218-
}
219-
220-
@media (hover: hover) and (pointer: fine) {
221-
[role="menuitem"][aria-current="page"]:hover::before {
222-
background: var(--link);
223-
}
224-
}
225215
}
226216

227217
[data-slot="meta"] {
@@ -328,6 +318,21 @@
328318
--nav-chevron-ink: light-dark(hsl(0 0% 8%), hsl(0 0% 95%));
329319
--nav-chevron-hover: var(--nav-name-hover);
330320
--nav-chevron-press: light-dark(#d2d2d2, #4b4b4b);
321+
/* The product name after the mark (and the docs' DOCS): its size, and the padding under it that puts OpenTUI Mono's
322+
caps (0.69 of the size) where they belong in the 25px row. */
323+
--nav-name-size: 15px;
324+
--nav-name-pad: 0.65px;
325+
326+
/* Phones: the docs sticky rows' 16px chevron, in an 18px box close to the name, its target reaching 26px past it so
327+
it stays 44px wide. The name grows to 20px, its caps centred in the 25px row (5.5px above and below), within half
328+
a pixel of the mark's inner rectangle. */
329+
@media (max-width: 60rem) {
330+
--nav-chevron-width: 18px;
331+
--nav-chevron-glyph: 16px;
332+
--nav-chevron-reach: 26px;
333+
--nav-name-size: 20px;
334+
--nav-name-pad: 1px;
335+
}
331336
--nav-logo-box-w: calc(15px * 1.492);
332337
--nav-logo-box-h: 25px;
333338

@@ -392,11 +397,10 @@
392397
height: 25px;
393398
margin: var(--nav-lockup-inset) 0 0;
394399
margin-inline-start: 6px;
395-
/* OpenTUI Mono's caps sit 0.325px below its line box's centre; this puts them on the mark's centre. */
396-
padding: 0 6px 0.65px;
400+
padding: 0 6px var(--nav-name-pad);
397401
background: none;
398402
color: var(--nav-lockup-ink);
399-
font: 700 15px/1 var(--nav-menu-mono, "OpenTUI Mono", ui-monospace, monospace);
403+
font: 700 var(--nav-name-size) / 1 var(--nav-menu-mono, "OpenTUI Mono", ui-monospace, monospace);
400404
letter-spacing: 0;
401405
text-decoration: none;
402406
text-transform: uppercase;

‎packages/stats/app/src/i18n.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ const en = {
4242
"header.githubAria": "Star OpenCode on GitHub",
4343
"header.github": "GitHub",
4444
"header.tryOpenCode": "Try OpenCode",
45+
// The header button's label on phones: the same where it fits beside the 20px product name at 375px, else a short
46+
// "Try now".
47+
"header.tryOpenCodeShort": "Try OpenCode",
4548
"header.openNav": "Open navigation",
4649
"header.closeNav": "Close navigation",
4750
"theme.groupLabel": "Theme",

‎packages/stats/app/src/i18n/ar.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export const dict = {
2323
"header.githubAria": "ضع نجمة لـ OpenCode على GitHub",
2424
"header.github": "GitHub",
2525
"header.tryOpenCode": "جرّب OpenCode",
26+
"header.tryOpenCodeShort": "جرّب OpenCode",
2627
"header.openNav": "فتح التنقل",
2728
"header.closeNav": "إغلاق التنقل",
2829
"theme.groupLabel": "السمة",

‎packages/stats/app/src/i18n/br.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export const dict = {
2323
"header.githubAria": "Dar estrela ao OpenCode no GitHub",
2424
"header.github": "GitHub",
2525
"header.tryOpenCode": "Experimente o OpenCode",
26+
"header.tryOpenCodeShort": "Experimente",
2627
"header.openNav": "Abrir navegação",
2728
"header.closeNav": "Fechar navegação",
2829
"theme.groupLabel": "Tema",

‎packages/stats/app/src/i18n/da.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export const dict = {
2323
"header.githubAria": "Giv OpenCode en stjerne på GitHub",
2424
"header.github": "GitHub",
2525
"header.tryOpenCode": "Prøv OpenCode",
26+
"header.tryOpenCodeShort": "Prøv nu",
2627
"header.openNav": "Åbn navigation",
2728
"header.closeNav": "Luk navigation",
2829
"theme.groupLabel": "Tema",

‎packages/stats/app/src/i18n/de.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export const dict = {
2323
"header.githubAria": "OpenCode auf GitHub mit Stern markieren",
2424
"header.github": "GitHub",
2525
"header.tryOpenCode": "OpenCode ausprobieren",
26+
"header.tryOpenCodeShort": "Jetzt testen",
2627
"header.openNav": "Navigation öffnen",
2728
"header.closeNav": "Navigation schließen",
2829
"theme.groupLabel": "Design",

‎packages/stats/app/src/i18n/es.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export const dict = {
2323
"header.githubAria": "Dale una estrella a OpenCode en GitHub",
2424
"header.github": "GitHub",
2525
"header.tryOpenCode": "Probar OpenCode",
26+
"header.tryOpenCodeShort": "Probar ahora",
2627
"header.openNav": "Abrir navegación",
2728
"header.closeNav": "Cerrar navegación",
2829
"theme.groupLabel": "Tema",

‎packages/stats/app/src/i18n/fr.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export const dict = {
2323
"header.githubAria": "Ajouter une étoile à OpenCode sur GitHub",
2424
"header.github": "GitHub",
2525
"header.tryOpenCode": "Essayer OpenCode",
26+
"header.tryOpenCodeShort": "Essayer",
2627
"header.openNav": "Ouvrir la navigation",
2728
"header.closeNav": "Fermer la navigation",
2829
"theme.groupLabel": "Thème",

‎packages/stats/app/src/i18n/it.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export const dict = {
2323
"header.githubAria": "Aggiungi una stella a OpenCode su GitHub",
2424
"header.github": "GitHub",
2525
"header.tryOpenCode": "Prova OpenCode",
26+
"header.tryOpenCodeShort": "Prova ora",
2627
"header.openNav": "Apri navigazione",
2728
"header.closeNav": "Chiudi navigazione",
2829
"theme.groupLabel": "Tema",

0 commit comments

Comments
 (0)