From 3479fd5317caf013c87f286f78dc2df5087103cd Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Mon, 16 Nov 2026 22:46:44 -0500 Subject: [PATCH] Trim text to its cap height and keep trimmed blocks on the 4px grid --- packages/app/src/pages/dom/actor.ts | 2 +- packages/app/src/pages/dom/home.ts | 2 +- packages/app/src/pages/dom/project.ts | 4 ++-- packages/app/src/pages/dom/styles.ts | 12 +++++++---- packages/app/src/platform/dom/header.ts | 20 ++++++++++-------- packages/app/src/shell/dom/compact.ts | 6 ++++-- packages/app/src/shell/dom/stack.ts | 1 + packages/app/src/views/browser.ts | 3 ++- packages/app/src/views/project.ts | 10 +++++---- packages/web/src/menu/element.ts | 3 ++- packages/web/src/tabs/element.ts | 13 ++++++++++-- packages/web/src/tokens/semantic.css | 8 +++++++- packages/web/src/tree/element.ts | 3 ++- packages/web/tests/tokens.spec.ts | 27 +++++++++++++++++++++++-- 14 files changed, 84 insertions(+), 30 deletions(-) diff --git a/packages/app/src/pages/dom/actor.ts b/packages/app/src/pages/dom/actor.ts index bc45fe4..483beeb 100644 --- a/packages/app/src/pages/dom/actor.ts +++ b/packages/app/src/pages/dom/actor.ts @@ -10,7 +10,7 @@ const actorSheet = sheet(` .profile { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--nib-space-md); align-items: start; } .profile:not(:has(> img)) { grid-template-columns: minmax(0, 1fr); } .profile > img { width: var(--nib-size-avatar); height: var(--nib-size-avatar); border-radius: 50%; object-fit: cover; background: var(--nib-color-surface); } - .profile > div { display: grid; gap: var(--nib-space-xs); } + .profile > div { display: grid; gap: var(--nib-space-sm); } .profile .description { white-space: pre-line; overflow-wrap: anywhere; } .repos { display: grid; gap: var(--nib-space-xs); margin: 0; padding: 0; list-style: none; } .repos li { display: flex; align-items: center; justify-content: space-between; gap: var(--nib-space-sm); padding-block: var(--nib-space-xs); border-block-end: var(--nib-size-border) solid var(--nib-color-border); } diff --git a/packages/app/src/pages/dom/home.ts b/packages/app/src/pages/dom/home.ts index 02f56aa..92edf6d 100644 --- a/packages/app/src/pages/dom/home.ts +++ b/packages/app/src/pages/dom/home.ts @@ -7,7 +7,7 @@ import { h, later } from "./h.ts"; import { command, PageElement, projectCards } from "./page.ts"; const homeSheet = sheet(` - .heading { display: flex; align-items: baseline; justify-content: space-between; gap: var(--nib-space-sm); margin-block-end: var(--nib-space-sm); } + .heading { display: flex; align-items: baseline; justify-content: space-between; gap: var(--nib-space-sm); margin-block-end: var(--nib-space-md); } .heading h2 { margin: 0; } .feed { display: grid; gap: var(--nib-space-xl); padding-block-start: var(--nib-space-lg); border-block-start: var(--nib-size-border) solid var(--nib-color-border); } .feed:not(:has(> section)) { display: none; } diff --git a/packages/app/src/pages/dom/project.ts b/packages/app/src/pages/dom/project.ts index 5c5ba34..e811c2e 100644 --- a/packages/app/src/pages/dom/project.ts +++ b/packages/app/src/pages/dom/project.ts @@ -8,7 +8,7 @@ import { PageElement, renderProjectMiss } from "./page.ts"; import { previewFor } from "./preview.ts"; const projectSheet = sheet(` - header { display: grid; gap: var(--nib-space-xs); } + header { display: grid; gap: var(--nib-space-sm); } .description { white-space: pre-line; overflow-wrap: anywhere; } .tags { margin: 0; padding: 0; list-style: none; } .tags li { padding-inline: var(--nib-space-xs); border: var(--nib-size-border) solid var(--nib-color-border); border-radius: var(--nib-radius-sm); color: var(--nib-color-text-muted); } @@ -23,7 +23,7 @@ const projectSheet = sheet(` .files { margin: 0; padding: 0; list-style: none; columns: 14rem; column-gap: var(--nib-space-lg); } .files li { font: var(--nib-font-code); overflow-wrap: anywhere; } .thread { display: grid; gap: var(--nib-space-md); margin: 0 0 var(--nib-space-lg); padding: 0; list-style: none; } - .thread li { display: grid; gap: var(--nib-space-2xs); } + .thread li { display: grid; gap: var(--nib-space-sm); } .thread li.reply { margin-inline-start: var(--nib-space-xl); padding-inline-start: var(--nib-space-md); border-inline-start: var(--nib-size-border) solid var(--nib-color-border); } .thread .text { white-space: pre-line; overflow-wrap: anywhere; } .thread button { justify-self: start; } diff --git a/packages/app/src/pages/dom/styles.ts b/packages/app/src/pages/dom/styles.ts index 84ad5c0..1a2edfc 100644 --- a/packages/app/src/pages/dom/styles.ts +++ b/packages/app/src/pages/dom/styles.ts @@ -17,10 +17,12 @@ export const pageSheet = sheet(` margin-inline: auto; padding: var(--nib-space-xl) var(--nib-space-lg); } - h1 { margin: 0; font: var(--nib-font-heading); font-weight: var(--nib-font-weight-strong); font-variation-settings: var(--nib-font-variation-heading); } - h2 { margin: 0 0 var(--nib-space-sm); font-size: inherit; font-weight: var(--nib-font-weight-strong); } + h1 { margin: 0 0 var(--nib-space-xs); font: var(--nib-font-heading); font-weight: var(--nib-font-weight-strong); font-variation-settings: var(--nib-font-variation-heading); } + h2 { margin: 0 0 var(--nib-space-md); font-size: inherit; font-weight: var(--nib-font-weight-strong); } h3 { margin: 0; font-size: inherit; font-weight: var(--nib-font-weight-strong); } p { margin: 0; } + /* Text blocks trim to cap height and baseline, so the gaps between them are the space tokens. */ + :is(h1, h2, h3, p) { text-box: trim-both cap alphabetic; padding-block-start: var(--nib-font-baseline-pad); } section { min-width: 0; } a { color: var(--nib-color-accent); text-underline-offset: 0.2em; } a:not(:hover) { text-decoration: none; } @@ -30,9 +32,10 @@ export const pageSheet = sheet(` .row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--nib-space-xs) var(--nib-space-sm); } code, pre { font: var(--nib-font-code); } + /* A row tall, around a label trimmed to its cap height. */ button, .button { display: inline-block; - padding-block: var(--nib-space-2xs); + padding-block: calc((var(--nib-size-row) - 1cap) / 2 - var(--nib-size-border)); padding-inline: var(--nib-space-sm); border: var(--nib-size-border) solid var(--nib-color-border); border-radius: var(--nib-radius-sm); @@ -40,6 +43,7 @@ export const pageSheet = sheet(` color: var(--nib-color-text); font: inherit; text-decoration: none; + text-box: trim-both cap alphabetic; } button:hover, .button:hover { background: var(--nib-color-hover); } button:disabled { color: var(--nib-color-text-muted); } @@ -71,7 +75,7 @@ export const pageSheet = sheet(` position: relative; display: grid; align-content: start; - gap: var(--nib-space-xs); + gap: var(--nib-space-sm); height: 100%; box-sizing: border-box; padding: var(--nib-space-md); diff --git a/packages/app/src/platform/dom/header.ts b/packages/app/src/platform/dom/header.ts index 19e61b9..e4213f5 100644 --- a/packages/app/src/platform/dom/header.ts +++ b/packages/app/src/platform/dom/header.ts @@ -30,16 +30,16 @@ const headerSheet = sheet(` } a { color: inherit; text-decoration: none; border-radius: var(--nib-radius-sm); } :is(a, button):focus-visible { outline: var(--nib-size-focus-ring) solid var(--nib-color-focus-ring); outline-offset: var(--nib-size-border); } - [part="home"] { font-weight: var(--nib-font-weight-strong); } + [part="home"] { font-weight: var(--nib-font-weight-strong); text-box: trim-both cap alphabetic; } [part="home"]:hover { text-decoration: underline; } - [part="project"] { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--nib-color-text-muted); } + [part="project"] { min-width: 0; overflow-x: clip; text-overflow: ellipsis; color: var(--nib-color-text-muted); text-box: trim-both cap alphabetic; } [part="project"]:empty { display: none; } [part="project"]::before { content: "/" / ""; margin-inline-end: var(--nib-space-md); color: var(--nib-color-border); } [part="project"] strong { color: var(--nib-color-text); font-weight: var(--nib-font-weight-normal); } [part="dirty"] { color: var(--nib-color-accent); } nib-toolbar { gap: var(--nib-space-2xs); } nib-toolbar:empty { display: none; } - [part="status"] { flex: 1 1 0; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; text-align: end; color: var(--nib-color-text-muted); } + [part="status"] { flex: 1 1 0; min-width: 0; margin: 0; overflow-x: clip; text-overflow: ellipsis; text-align: end; color: var(--nib-color-text-muted); text-box: trim-both cap alphabetic; } [part="status"][data-tone="error"] { color: var(--nib-color-danger); } [part="end"] { display: flex; align-items: center; gap: var(--nib-space-xs); } @@ -47,7 +47,8 @@ const headerSheet = sheet(` display: inline-flex; align-items: center; gap: var(--nib-space-xs); - padding-block: var(--nib-space-2xs); + min-block-size: var(--nib-size-row); + padding-block: var(--nib-space-none); padding-inline: var(--nib-space-sm); border: var(--nib-size-border) solid var(--nib-color-border); border-radius: var(--nib-radius-sm); @@ -57,6 +58,7 @@ const headerSheet = sheet(` } button:hover, button[aria-expanded="true"] { background: var(--nib-color-hover); } button:disabled { color: var(--nib-color-text-muted); } + button > span:not(.avatar) { text-box: trim-both cap alphabetic; } .caret { color: var(--nib-color-text-muted); font-size: var(--nib-size-glyph); } [part="account"] { padding-inline: var(--nib-space-2xs) var(--nib-space-sm); border-color: transparent; background: none; border-radius: var(--nib-size-avatar-small); } .avatar { @@ -72,7 +74,7 @@ const headerSheet = sheet(` font: var(--nib-font-label); font-weight: var(--nib-font-weight-strong); } - .handle { max-width: 16rem; overflow: hidden; text-overflow: ellipsis; } + .handle { max-width: 16rem; overflow-x: clip; text-overflow: ellipsis; } .visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } nib-menu { min-inline-size: 14rem; } nib-menu-item .muted { color: var(--nib-color-text-muted); } @@ -81,7 +83,7 @@ const headerSheet = sheet(` @container nib-header (max-width: 640px) { [part="bar"] { column-gap: var(--nib-space-sm); padding-inline-start: var(--nib-space-sm); } .handle { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); } - [part="status"]:not(:empty) { order: 1; flex-basis: 100%; padding-block-end: var(--nib-space-xs); white-space: normal; text-align: start; } + [part="status"]:not(:empty) { order: 1; flex-basis: 100%; padding-block-start: var(--nib-font-baseline-pad); padding-block-end: var(--nib-space-xs); white-space: normal; text-align: start; } [part="status"]:empty { flex-basis: 0; } } @media (pointer: coarse) { @@ -101,7 +103,7 @@ const headerSheet = sheet(` } dialog:modal { overscroll-behavior: contain; width: min(24rem, 100% - 2 * var(--nib-space-lg)); box-sizing: border-box; } dialog::backdrop { background: var(--nib-color-scrim); overflow: hidden; overscroll-behavior: contain; } - dialog h2 { margin-block: 0 var(--nib-space-md); font-size: inherit; font-weight: var(--nib-font-weight-strong); } + dialog h2 { margin-block: 0 var(--nib-space-md); font-size: inherit; font-weight: var(--nib-font-weight-strong); text-box: trim-both cap alphabetic; } dialog label { display: grid; gap: var(--nib-space-2xs); } dialog :is(input, select) { box-sizing: border-box; @@ -274,7 +276,9 @@ export class AppHeaderElement extends HTMLElement { } #button(text: string, onClick: () => void): HTMLButtonElement { - const button = Object.assign(document.createElement("button"), { type: "button", textContent: text }); + const button = Object.assign(document.createElement("button"), { type: "button" }); + // A span, so the label can trim to its cap height: a flex container's bare text can't. + if (text) button.append(Object.assign(document.createElement("span"), { textContent: text })); button.addEventListener("click", onClick); return button; } diff --git a/packages/app/src/shell/dom/compact.ts b/packages/app/src/shell/dom/compact.ts index 1107e28..4fd55f2 100644 --- a/packages/app/src/shell/dom/compact.ts +++ b/packages/app/src/shell/dom/compact.ts @@ -56,11 +56,12 @@ export const compactSheet = sheet(` [part="title"] { flex: 1; min-width: 0; - overflow: hidden; + overflow-x: clip; text-overflow: ellipsis; white-space: nowrap; text-align: center; font-weight: var(--nib-font-weight-strong); + text-box: trim-both cap alphabetic; } button[part] { min-width: var(--nib-size-touch-target); @@ -71,6 +72,7 @@ export const compactSheet = sheet(` background: none; color: inherit; font: inherit; + text-box: trim-both cap alphabetic; } button[part]:focus-visible { outline: var(--nib-size-focus-ring) solid var(--nib-color-focus-ring); @@ -120,7 +122,7 @@ export const compactSheet = sheet(` background: var(--nib-color-surface); border-bottom: var(--nib-size-border) solid var(--nib-color-border); } - [part="drawer-header"] h2 { margin: 0; font: inherit; font-weight: var(--nib-font-weight-strong); } + [part="drawer-header"] h2 { margin: 0; font: inherit; font-weight: var(--nib-font-weight-strong); text-box: trim-both cap alphabetic; } [part="drawer-body"] { display: flex; flex: 1; min-height: 0; } [part="drawer-body"] > nib-tabpanel { position: static; flex: 1; } `); diff --git a/packages/app/src/shell/dom/stack.ts b/packages/app/src/shell/dom/stack.ts index d6615f2..7e913d1 100644 --- a/packages/app/src/shell/dom/stack.ts +++ b/packages/app/src/shell/dom/stack.ts @@ -44,6 +44,7 @@ export const SECTION_CSS = ` outline: var(--nib-size-focus-ring) solid var(--nib-color-focus-ring); outline-offset: calc(-1 * var(--nib-size-focus-ring)); } + [part~="section-header"] > span { text-box: trim-both cap alphabetic; } [part~="section-header"] nib-icon { transition: rotate 0.1s; } [part~="section-header"][aria-expanded="false"] nib-icon { rotate: -90deg; } [part~="section-header"][data-dragging] { opacity: 0.4; } diff --git a/packages/app/src/views/browser.ts b/packages/app/src/views/browser.ts index 838c272..65052c6 100644 --- a/packages/app/src/views/browser.ts +++ b/packages/app/src/views/browser.ts @@ -81,8 +81,9 @@ const browserSheet = sheet(` } iframe:focus-visible { outline: var(--nib-size-focus-ring) solid var(--nib-color-focus-ring); outline-offset: calc(-1 * var(--nib-size-focus-ring)); } [part="status"], [part="empty"] { flex: 1; margin: 0; padding: var(--nib-space-md); font: var(--nib-font-body); color: var(--nib-color-text-muted); } - [part="empty"] h2 { margin: 0 0 var(--nib-space-xs); font: inherit; font-weight: var(--nib-font-weight-strong); color: var(--nib-color-text); } + [part="empty"] h2 { margin: 0 0 var(--nib-space-sm); font: inherit; font-weight: var(--nib-font-weight-strong); color: var(--nib-color-text); } [part="empty"] p { margin: 0; } + :is([part="empty"] h2, [part="empty"] p) { text-box: trim-both cap alphabetic; padding-block-start: var(--nib-font-baseline-pad); } `); /** diff --git a/packages/app/src/views/project.ts b/packages/app/src/views/project.ts index 06c72fc..b9b52a8 100644 --- a/packages/app/src/views/project.ts +++ b/packages/app/src/views/project.ts @@ -8,7 +8,7 @@ export type ProjectSource = Pick; const projectInfoSheet = sheet(` :host { display: block; overflow: auto; box-sizing: border-box; padding: var(--nib-space-sm); font: var(--nib-font-body); color: var(--nib-color-text); } - [part="owner"] { display: flex; align-items: center; gap: var(--nib-space-xs); margin-block-end: var(--nib-space-xs); } + [part="owner"] { display: flex; align-items: center; gap: var(--nib-space-xs); margin-block-end: var(--nib-space-sm); } .avatar { width: var(--nib-size-avatar-small); height: var(--nib-size-avatar-small); @@ -22,14 +22,16 @@ const projectInfoSheet = sheet(` display: inline-grid; place-items: center; } + [part="owner"] a { text-box: trim-both cap alphabetic; } + :is([part="name"], dt, dd, [part="hint"]) { text-box: trim-both cap alphabetic; padding-block-start: var(--nib-font-baseline-pad); } a { color: inherit; text-decoration: none; } a:hover { text-decoration: underline; } a:focus-visible { outline: var(--nib-size-focus-ring) solid var(--nib-color-focus-ring); outline-offset: var(--nib-size-border); } - [part="name"] { display: block; margin-block-end: var(--nib-space-xs); font-weight: var(--nib-font-weight-strong); } - dl { margin: 0; display: grid; gap: var(--nib-space-2xs); } + [part="name"] { display: block; margin-block-end: var(--nib-space-sm); font-weight: var(--nib-font-weight-strong); } + dl { margin: 0; display: grid; gap: var(--nib-space-sm); } dt { color: var(--nib-color-text-muted); font: var(--nib-font-label); } dd { margin: 0; } - [part="hint"] { margin: var(--nib-space-2xs) 0 0; color: var(--nib-color-text-muted); } + [part="hint"] { margin: 0; color: var(--nib-color-text-muted); } .tags { display: flex; flex-wrap: wrap; gap: var(--nib-space-2xs); } .tag { border: var(--nib-size-border) solid var(--nib-color-border); diff --git a/packages/web/src/menu/element.ts b/packages/web/src/menu/element.ts index 6c6df35..6bc60ad 100644 --- a/packages/web/src/menu/element.ts +++ b/packages/web/src/menu/element.ts @@ -306,9 +306,10 @@ export class MenuItemElement extends HTMLElement { const groupSheet = sheet(` :host { display: block; } [part="label"] { - padding: var(--nib-space-xs) var(--nib-space-sm) var(--nib-space-2xs); + padding: var(--nib-space-sm) var(--nib-space-sm) var(--nib-space-xs); color: var(--nib-color-text-muted); font: var(--nib-font-label); + text-box: trim-both cap alphabetic; } `); diff --git a/packages/web/src/tabs/element.ts b/packages/web/src/tabs/element.ts index 5368e6c..6da7e4a 100644 --- a/packages/web/src/tabs/element.ts +++ b/packages/web/src/tabs/element.ts @@ -44,8 +44,17 @@ const tabSheet = sheet(` outline-offset: calc(-1 * var(--nib-size-focus-ring)); } /* The slot is itself a flex item of :host, with the usual flex default of min-width: auto; - without overriding it, it won't actually shrink below its content to let text clip/ellipsize. */ - slot { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } + without overriding it, it won't actually shrink below its content to let text clip/ellipsize. + Trimmed to the cap height so the row centers the letters, not the line box; it clips only + inline, since a clip in the block axis would cut the descenders the trim leaves outside. */ + slot { + display: block; + min-width: 0; + overflow-x: clip; + text-overflow: ellipsis; + white-space: nowrap; + text-box: trim-both cap alphabetic; + } [part="close"] { all: unset; display: inline-flex; diff --git a/packages/web/src/tokens/semantic.css b/packages/web/src/tokens/semantic.css index 27b3f83..e87657c 100644 --- a/packages/web/src/tokens/semantic.css +++ b/packages/web/src/tokens/semantic.css @@ -86,8 +86,14 @@ --nib-font-label: var(--nib-font-size-label) / round(up, var(--nib-font-size-label) * var(--nib-raw-line-height-tight), var(--nib-grid-fine)) var(--nib-font-family-sans); --nib-font-code: var(--nib-font-size-code) / round(up, var(--nib-font-size-code) * var(--nib-raw-line-height-normal), var(--nib-grid-fine)) var(--nib-font-family-mono); --nib-font-terminal: var(--nib-font-size-terminal) / round(up, var(--nib-font-size-terminal) * var(--nib-raw-line-height-tight), var(--nib-grid-fine)) var(--nib-font-family-mono); + /* + * A text block trimmed to its cap height (text-box) is as tall as 1cap, which is rarely a whole + * pixel. Padding its top up to the fine grid keeps the block's height, and so its first baseline + * and the layout below it, on 4px steps. Resolves against the font of the element that uses it. + */ + --nib-font-baseline-pad: calc(round(up, 1cap, var(--nib-grid-fine)) - 1cap); /* Fraunces' soft cut. The font shorthand resets variations, so set this after it. */ - --nib-font-variation-heading: "SOFT" 50, "WONK" 0; + --nib-font-variation-heading: "SOFT" 100, "WONK" 1; /* Uppercase labels open up a little. */ --nib-font-tracking-caps: 0.04em; } diff --git a/packages/web/src/tree/element.ts b/packages/web/src/tree/element.ts index 363f922..32cf5df 100644 --- a/packages/web/src/tree/element.ts +++ b/packages/web/src/tree/element.ts @@ -36,7 +36,8 @@ const itemSheet = sheet(` @container nib-tree (width < 160px) { :host { --indent: var(--nib-space-sm); padding-inline: var(--nib-space-xs); } } - [part="label"] { flex: 1; overflow: hidden; text-overflow: ellipsis; } + /* Trimmed like a tab's label, and clipped only inline for the same reason. */ + [part="label"] { flex: 1; min-width: 0; overflow-x: clip; text-overflow: ellipsis; text-box: trim-both cap alphabetic; } ::slotted([slot="action"]) { border: 0; background: none; diff --git a/packages/web/tests/tokens.spec.ts b/packages/web/tests/tokens.spec.ts index 04716b2..68422af 100644 --- a/packages/web/tests/tokens.spec.ts +++ b/packages/web/tests/tokens.spec.ts @@ -62,12 +62,13 @@ const TYPE_PARTS = [ "--nib-font-size-terminal", "--nib-font-weight-normal", "--nib-font-weight-strong", + "--nib-font-baseline-pad", "--nib-font-variation-heading", "--nib-font-tracking-caps", ]; -function isMultipleOf(value: number, step: number): boolean { - return Math.abs(Math.round(value / step) * step - value) < 0.01; +function isMultipleOf(value: number, step: number, tolerance = 0.01): boolean { + return Math.abs(Math.round(value / step) * step - value) < tolerance; } async function declaredTokens(page: Page, pattern: RegExp): Promise { @@ -129,6 +130,28 @@ test("a theme that changes a type size still lands its line-height on the 4px gr expect(lineHeight).toBe(24); }); +test("a trimmed text block padded by the baseline pad is a whole number of 4px steps tall", async ({ page }) => { + await page.goto("/tokens.html"); + const heights = await page.evaluate(async (roles) => { + const block = document.createElement("p"); + block.textContent = "Hamburgefonstiv"; + block.style.cssText = "margin: 0; text-box: trim-both cap alphabetic; padding-block-start: var(--nib-font-baseline-pad)"; + document.body.append(block); + const out: Record = {}; + for (const role of roles) { + block.style.font = `var(${role})`; + await document.fonts.load(getComputedStyle(block).font); + out[role] = block.getBoundingClientRect().height; + } + return out; + }, Object.keys(TYPE_ROLES)); + expect(heights).toEqual(Object.fromEntries(Object.keys(TYPE_ROLES).map((role) => [role, expect.any(Number)]))); + for (const [role, height] of Object.entries(heights)) { + // Chrome lays text out in 1/64px units, so 1cap rounds to within a couple of them. + expect(isMultipleOf(height, 4, 1 / 32), `${role} block is ${height}px tall`).toBe(true); + } +}); + test("outer tokens land on the 8px grid", async ({ page }) => { await page.goto("/tokens.html"); const probe = page.locator("#probe"); -- knotmirror 0.0.1