From c887e77a79be596c2ffc64b1b058472398523873 Mon Sep 17 00:00:00 2001
From: bailey <74082460+bmjcoding@users.noreply.github.com>
Date: Mon, 23 Nov 2026 20:55:56 -0600
Subject: [PATCH 01/29] The edge rule: a ghost control hung at its head's edge,
and side insets by direction
Button and IconButton take edge (data-edge in the skill): what the control shows
sits on the head's line and its box hangs into the room the head declares
(--basalt-edge-room), never more; the ring is +2 where 4 is left, else -2.
The root's side insets map to start and end (swapped right to left) and every
bar, sheet and menu row reads them. Sheet heads take equal padding and hang
Close (R-4, S2). DECISIONS 336.
Co-Authored-By: Claude Opus 5.5
---
packages/react/src/button.tsx | 28 ++++-
packages/react/src/index.ts | 2 +-
packages/react/src/overlays.tsx | 2 +-
packages/react/src/styles/components.css | 112 +++++++++++++++----
tools/html-skill/src/core.css | 26 ++++-
tools/html-skill/src/modules/app-shell.css | 5 +-
tools/html-skill/src/modules/sheet.css | 18 ++-
tools/html-skill/src/modules/tab-bar.css | 4 +-
tools/html-skill/src/modules/topbar-nav.css | 8 +-
tools/html-skill/src/modules/topbar.css | 15 ++-
tools/html-skill/src/modules/type-layout.css | 2 +-
tools/html-skill/src/usage/dialog-form.md | 2 +-
tools/html-skill/src/usage/sheet.md | 2 +-
13 files changed, 172 insertions(+), 54 deletions(-)
diff --git a/packages/react/src/button.tsx b/packages/react/src/button.tsx
index 09c535f1..ef623fc1 100644
--- a/packages/react/src/button.tsx
+++ b/packages/react/src/button.tsx
@@ -46,8 +46,18 @@ type BaseProps = Omit, "children"> & {
* "(opens in a new tab)". The arrow and the words come from the target alone; there is no prop for them.
*/
newTabLabel?: string;
+ /**
+ * A ghost button that starts or ends a head, a bar, a band or a row (DECISIONS 336): what it shows (its glyph, or its words) goes on the
+ * head's content line and its own box hangs into the head's padding, only as far as the head's `--basalt-edge-room` allows (none when the
+ * head declares nothing). Its focus ring stays at +2 where the room keeps 4 and is drawn inside where it does not. Ghost only: with another
+ * variant it does nothing (and warns once in development).
+ */
+ edge?: ButtonEdge;
};
+/** The side of its head a ghost button is hung at. */
+export type ButtonEdge = "start" | "end";
+
/**
* A toggle: `pressed` writes `aria-pressed`. Only secondary and ghost buttons toggle (a latched primary would read as the
* primary action, a latched danger as an error); on those two `pressed` is a type error.
@@ -98,9 +108,21 @@ const iconSize = (size: ControlSize) => (size === "xl" ? 20 : 16);
declare const process: { env: { NODE_ENV?: string } };
let warnedBare = false;
+let warnedEdge = false;
+
+/** `data-edge` for a ghost button; any other variant gets none, and a development warning once. */
+function edgeOf(edge: ButtonEdge | undefined, variant: ButtonVariant): ButtonEdge | undefined {
+ if (edge === undefined) return undefined;
+ if (variant === "ghost") return edge;
+ if (process.env.NODE_ENV !== "production" && !warnedEdge) {
+ warnedEdge = true;
+ console.warn("Basalt Button: `edge` hangs a ghost button at its head's edge; with another variant it does nothing (DECISIONS 336)");
+ }
+ return undefined;
+}
/** A button. Its label says what happens: "Deploy", not "OK". */
-export function Button({ variant = "secondary", size = "md", fullWidth, icon, iconEnd, fillSafe, pressed, amount, amountReserve, count, note, loading: loadingProp = false, waitForAnswer = true, disabled, onClick, className, children, newTabLabel, render, ref, ...props }: ButtonProps) {
+export function Button({ variant = "secondary", size = "md", fullWidth, edge, icon, iconEnd, fillSafe, pressed, amount, amountReserve, count, note, loading: loadingProp = false, waitForAnswer = true, disabled, onClick, className, children, newTabLabel, render, ref, ...props }: ButtonProps) {
// A button rendered as a link that opens a new tab draws the arrow in its trailing slot and says so in its name.
// A handler on the rendered element is taken into the press, so the wait guards it too.
const [rendered, handler] = takeClick(render, onClick);
@@ -130,6 +152,7 @@ export function Button({ variant = "secondary", size = "md", fullWidth, icon, ic
data-variant={variant}
data-size={size}
data-full-width={fullWidth ? "" : undefined}
+ data-edge={edgeOf(edge, variant)}
data-lines={note ? "" : undefined}
className={withClass("basalt-button", className)}
onClick={wait.press}
@@ -216,7 +239,7 @@ function DoneSeat({ icon, doneIcon, done, size, selected, fillSafe }: DoneSeatPr
}
/** A square button with only an icon. As a toggle it has no check: the plate, the ink step and the glyph's selected form say pressed. */
-export function IconButton({ variant = "ghost", size = "md", fullWidth, icon, done, doneIcon = CheckGlyph, fillSafe, pressed, label, loading: loadingProp = false, waitForAnswer = true, disabled, onClick, className, newTabLabel, render, ref, ...props }: IconButtonProps) {
+export function IconButton({ variant = "ghost", size = "md", fullWidth, edge, icon, done, doneIcon = CheckGlyph, fillSafe, pressed, label, loading: loadingProp = false, waitForAnswer = true, disabled, onClick, className, newTabLabel, render, ref, ...props }: IconButtonProps) {
// A handler on the rendered element is taken into the press, so the wait guards it too.
const [rendered, handler] = takeClick(render, onClick);
const link = newTabRender(rendered);
@@ -240,6 +263,7 @@ export function IconButton({ variant = "ghost", size = "md", fullWidth, icon, do
data-size={size}
data-icon-only=""
data-full-width={fullWidth ? "" : undefined}
+ data-edge={edgeOf(edge, variant)}
data-done={done ? "" : undefined}
className={withClass("basalt-button", className)}
onClick={wait.press}
diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts
index 9193ef7f..0637aa4a 100644
--- a/packages/react/src/index.ts
+++ b/packages/react/src/index.ts
@@ -1,5 +1,5 @@
export { Button, IconButton } from "./button";
-export type { ButtonProps, ButtonVariant, ControlSize, IconButtonProps } from "./button";
+export type { ButtonEdge, ButtonProps, ButtonVariant, ControlSize, IconButtonProps } from "./button";
export { Icon } from "./icon";
export type { IconProps, IconSize } from "./icon";
// The core set: one module per glyph, so an app bundles the ones it imports.
diff --git a/packages/react/src/overlays.tsx b/packages/react/src/overlays.tsx
index 442536bd..3217bbb2 100644
--- a/packages/react/src/overlays.tsx
+++ b/packages/react/src/overlays.tsx
@@ -113,7 +113,7 @@ export function SheetHeader({ closeLabel, className, children, ...props }: Sheet
return (
{children}
- {closeLabel ? } /> : null}
+ {closeLabel ? } /> : null}
);
}
diff --git a/packages/react/src/styles/components.css b/packages/react/src/styles/components.css
index 24145fce..9a5b2a32 100644
--- a/packages/react/src/styles/components.css
+++ b/packages/react/src/styles/components.css
@@ -244,6 +244,39 @@
.basalt-button[data-icon-only] { width: var(--_h); padding: 0; }
.basalt-button[data-full-width] { display: flex; width: 100%; }
+ /* A ghost control at an edge (DECISIONS 336): `edge="start"` or `"end"` puts what it shows (its glyph, or its words) on the head's content
+ line and hangs its own box into the head's padding by its inset: its inline padding with words, half the size it is drawn at less its
+ glyph when icon-only. It hangs only into room the head declares (`--basalt-edge-room`, or `-start` and `-end`: the head's padding on that
+ side less any safe-area inset), never by more; a head that declares nothing gives no room. `--_drawn` is the size in force on the button
+ itself (the touch block raises it to 44) and `--_glyph` the size its glyph is drawn at. The hang is plate and hit area, never layout. */
+ .basalt-button { --_drawn: var(--_h); --_glyph: var(--basalt-size-icon-sm); }
+ .basalt-button[data-size="xl"] { --_glyph: var(--basalt-size-icon-md); }
+ .basalt-button[data-variant="ghost"][data-edge] { --_inset: var(--_px); }
+ .basalt-button[data-variant="ghost"][data-icon-only][data-edge] { --_inset: calc((var(--_drawn) - var(--_glyph)) / 2); }
+ .basalt-button[data-variant="ghost"][data-edge="start"] {
+ --_hang: min(var(--_inset), var(--basalt-edge-room-start, var(--basalt-edge-room, var(--basalt-space-0))));
+ margin-inline-start: calc(-1 * var(--_hang));
+ }
+ .basalt-button[data-variant="ghost"][data-edge="end"] {
+ --_hang: min(var(--_inset), var(--basalt-edge-room-end, var(--basalt-edge-room, var(--basalt-space-0))));
+ margin-inline-end: calc(-1 * var(--_hang));
+ }
+ /* The ring, by the rule every control has: at +2 where the hung box keeps focus-offset + focus-width (4) from the edge of its room, inside at
+ -2 only where it does not. What is left of the room after the hang, less those 4, times 999: a whole pixel short gives -2, none short +2.
+ With no room declared the fallback is the hang plus a target, so the ring is the ordinary +2. */
+ .basalt-button[data-variant="ghost"][data-edge="start"]:focus-visible {
+ outline-offset: clamp(calc(-1 * var(--basalt-size-focus-width)),
+ calc((var(--basalt-edge-room-start, var(--basalt-edge-room, calc(var(--_hang) + var(--basalt-size-tap-min)))) - var(--_hang)
+ - var(--basalt-size-focus-offset) - var(--basalt-size-focus-width)) * 999 + var(--basalt-size-focus-offset)),
+ var(--basalt-size-focus-offset));
+ }
+ .basalt-button[data-variant="ghost"][data-edge="end"]:focus-visible {
+ outline-offset: clamp(calc(-1 * var(--basalt-size-focus-width)),
+ calc((var(--basalt-edge-room-end, var(--basalt-edge-room, calc(var(--_hang) + var(--basalt-size-tap-min)))) - var(--_hang)
+ - var(--basalt-size-focus-offset) - var(--basalt-size-focus-width)) * 999 + var(--basalt-size-focus-offset)),
+ var(--basalt-size-focus-offset));
+ }
+
.basalt-button[data-variant="primary"] {
background: var(--basalt-action-primary);
color: var(--basalt-action-primary-text);
@@ -1378,9 +1411,13 @@
--basalt-sticky-offset: calc(var(--basalt-size-header) + var(--_inset-top)); /* what a sticky thing under a bar adds */
--basalt-site-row: var(--basalt-sticky-offset); /* the resting row's height: a bar that arrives keeps it in a slot, and a stage is pulled up by it */
--basalt-bottom-offset: var(--basalt-space-0);
- --_pad-left: max(var(--basalt-gutter), var(--_inset-left)); /* a bar's inline padding: the gutter or the side inset */
- --_pad-right: max(var(--basalt-gutter), var(--_inset-right));
+ /* The side insets by direction (DECISIONS 336): start and end are left and right, swapped right to left, so a bar pads the side its inset is on. */
+ --_inset-start: var(--_inset-left);
+ --_inset-end: var(--_inset-right);
+ --_pad-start: max(var(--basalt-gutter), var(--_inset-start)); /* a bar's inline padding: the gutter or the side inset */
+ --_pad-end: max(var(--basalt-gutter), var(--_inset-end));
}
+ :root:dir(rtl) { --_inset-start: var(--_inset-right); --_inset-end: var(--_inset-left); }
/* stylelint-disable-next-line unit-disallowed-list -- size-breakpoint-md (720px): a media query cannot read a token; below it the links go into the menu and the gutter narrows */
@media (width < 720px) {
:root { --basalt-gutter: var(--basalt-size-gutter-narrow); }
@@ -1433,11 +1470,11 @@
:root:has(.basalt-site-header, .basalt-app-header, .basalt-sticky-bar) .basalt-skip-link {
position: fixed;
top: calc(var(--basalt-sticky-offset) + var(--basalt-space-2));
- inset-inline-start: var(--_pad-left);
+ inset-inline-start: var(--_pad-start);
transform: none;
}
:root:has(.basalt-site-header) .basalt-skip-link {
- inset-inline-start: max(var(--_pad-left), calc((100% - var(--basalt-size-page-width)) / 2 + var(--_pad-left)));
+ inset-inline-start: max(var(--_pad-start), calc((100% - var(--basalt-size-page-width)) / 2 + var(--_pad-start)));
}
/* In an app shell the skip link starts on the brand link's start edge, as it does under a site header: from 1024 that is the sidebar's
space-3 and the brand band's space-1-5 + space-3 in from the shell's start (and a capped shell starts half the window's spare width
@@ -1490,7 +1527,7 @@
align-items: center;
height: calc(var(--basalt-size-header) - var(--basalt-size-hairline));
padding-top: var(--basalt-size-hairline);
- padding-inline: var(--_pad-left) var(--_pad-right);
+ padding-inline: var(--_pad-start) var(--_pad-end);
}
.basalt-site-bar { max-width: var(--basalt-size-page-width); margin-inline: auto; }
.basalt-app-bar { gap: var(--basalt-space-2); }
@@ -1707,12 +1744,13 @@
flex: none;
height: var(--basalt-size-header);
padding-top: var(--basalt-size-hairline);
- padding-inline: var(--_pad-left) var(--_pad-right);
+ padding-inline: var(--_pad-start) var(--_pad-end);
border-bottom: var(--basalt-size-hairline) solid var(--basalt-border-divider);
}
/* The menu's first row when the page has a loops toggle: the same control in its Button form, at the band's own gutter, 44 on touch like the foot's button. */
.basalt-site-menu-loops {
- padding: var(--basalt-space-2) var(--_pad-right) 0 var(--_pad-left);
+ padding-block: var(--basalt-space-2) 0;
+ padding-inline: var(--_pad-start) var(--_pad-end);
}
.basalt-site-menu-loops .basalt-button {
--_h: var(--basalt-size-tap-min);
@@ -1720,10 +1758,11 @@
}
.basalt-site-menu-nav {
padding-block: var(--basalt-space-2);
- padding-inline: max(var(--basalt-space-1-5), var(--_inset-left)) max(var(--basalt-space-1-5), var(--_inset-right));
+ padding-inline: max(var(--basalt-space-1-5), var(--_inset-start)) max(var(--basalt-space-1-5), var(--_inset-end));
}
.basalt-site-menu-foot {
- padding: var(--basalt-space-2) var(--_pad-right) max(var(--basalt-space-4), var(--_inset-bottom)) var(--_pad-left);
+ padding-block: var(--basalt-space-2) max(var(--basalt-space-4), var(--_inset-bottom));
+ padding-inline: var(--_pad-start) var(--_pad-end);
}
.basalt-site-menu-foot .basalt-button {
--_h: var(--basalt-size-tap-min);
@@ -1894,7 +1933,8 @@
box-sizing: border-box;
min-width: 0;
max-width: var(--basalt-size-page-width);
- padding: var(--basalt-space-6) var(--_pad-right) var(--basalt-space-16) var(--_pad-left);
+ padding-block: var(--basalt-space-6) var(--basalt-space-16);
+ padding-inline: var(--_pad-start) var(--_pad-end);
}
.basalt-app-shell[data-capped] .basalt-app-main { max-width: none; }
/* The rail, 72: Nav's collapsed form, the brand's mark alone. */
@@ -1968,7 +2008,7 @@
box-sizing: border-box;
display: block;
padding-bottom: var(--_inset-bottom);
- padding-inline: var(--_inset-left) var(--_inset-right);
+ padding-inline: var(--_inset-start) var(--_inset-end);
border-top: var(--basalt-size-hairline) solid var(--basalt-border-hairline);
background: var(--basalt-surface-page);
color: var(--basalt-text-primary);
@@ -5597,6 +5637,28 @@
bar's 44px buttons are. A segment keeps its 6: it is nested in a track that is 8 with 2 of padding. */
.basalt-button,
.basalt-button[data-size] { --_radius: var(--basalt-radius-md); }
+ /* The size in force here (DECISIONS 336): a hung icon-only button drawn at 44 hangs 14 on a 16px glyph. */
+ .basalt-button { --_drawn: max(var(--_h), var(--basalt-size-tap-min)); }
+ /* A hung control with words is as wide as its words, so its inset is its padding; what it lacks of 44 is hit area on ::before (46: the
+ press's .98 keeps it at 45.08), toward the edge as far as the room allows and the rest toward the inside. ::before, as a pressed
+ Button's ::after is taken. */
+ .basalt-button[data-variant="ghost"][data-edge]:not([data-icon-only]) {
+ min-width: 0;
+ --_miss: max(var(--basalt-space-0), calc(var(--basalt-size-tap-min) + 2 * var(--basalt-size-hairline) - 100%));
+ }
+ .basalt-button[data-variant="ghost"][data-edge]:not([data-icon-only])::before {
+ content: "";
+ position: absolute;
+ inset-block: min(var(--basalt-space-0), calc((100% - var(--basalt-size-tap-min)) / 2 - var(--basalt-size-hairline)));
+ }
+ .basalt-button[data-variant="ghost"][data-edge="end"]:not([data-icon-only])::before {
+ --_out: min(calc(var(--_miss) / 2), calc(var(--basalt-edge-room-end, var(--basalt-edge-room, var(--basalt-space-0))) - var(--_hang)));
+ inset-inline: calc(var(--_out) - var(--_miss)) calc(-1 * var(--_out));
+ }
+ .basalt-button[data-variant="ghost"][data-edge="start"]:not([data-icon-only])::before {
+ --_out: min(calc(var(--_miss) / 2), calc(var(--basalt-edge-room-start, var(--basalt-edge-room, var(--basalt-space-0))) - var(--_hang)));
+ inset-inline: calc(-1 * var(--_out)) calc(var(--_out) - var(--_miss));
+ }
.basalt-input,
.basalt-input[data-size],
.basalt-select-trigger,
@@ -5676,13 +5738,11 @@
display: flex;
flex-direction: column;
overflow-y: auto;
- padding: var(--basalt-space-6);
- padding-top: max(var(--basalt-space-6), env(safe-area-inset-top));
- padding-right: max(var(--basalt-space-6), env(safe-area-inset-right));
+ padding-block-start: max(var(--basalt-space-6), env(safe-area-inset-top));
+ padding-inline: max(var(--basalt-space-6), var(--_inset-start)) max(var(--basalt-space-6), var(--_inset-end));
/* The bottom padding: space-6, or the home indicator's safe area where it is deeper. An on-screen keyboard covers the safe area, so there it is space-6. */
--_sheet-floor: max(var(--basalt-space-6), env(safe-area-inset-bottom));
- padding-bottom: var(--_sheet-floor);
- padding-left: max(var(--basalt-space-6), env(safe-area-inset-left));
+ padding-block-end: var(--_sheet-floor);
background: var(--_surface, var(--basalt-surface-overlay));
color: var(--basalt-text-primary);
box-shadow: var(--basalt-shadow-modal);
@@ -5745,7 +5805,11 @@
align-items: center;
justify-content: space-between;
gap: var(--basalt-space-3);
- padding: max(var(--basalt-space-3), env(safe-area-inset-top)) max(var(--basalt-space-3), env(safe-area-inset-right)) var(--basalt-space-3) max(var(--basalt-space-5), env(safe-area-inset-left));
+ padding-block: max(var(--basalt-space-3), env(safe-area-inset-top)) var(--basalt-space-3);
+ /* The same padding on both sides (DECISIONS 336): Close is hung at the end, its glyph on the line the title starts on. Its room is the end
+ padding less the inset there, so the whole target stays clear of a notch or a corner. */
+ padding-inline: max(var(--basalt-space-5), var(--_inset-start)) max(var(--basalt-space-5), var(--_inset-end));
+ --basalt-edge-room-end: calc(max(var(--basalt-space-5), var(--_inset-end)) - var(--_inset-end));
border-bottom: var(--basalt-size-hairline) solid var(--basalt-border-divider);
}
.basalt-sheet-head-text { flex: 1; min-width: 0; }
@@ -5757,7 +5821,7 @@
min-height: 0;
overflow-y: auto;
overscroll-behavior: contain;
- padding-inline: max(var(--basalt-space-5), env(safe-area-inset-left)) max(var(--basalt-space-5), env(safe-area-inset-right));
+ padding-inline: max(var(--basalt-space-5), var(--_inset-start)) max(var(--basalt-space-5), var(--_inset-end));
/* The body clips what it scrolls: space-1-5 at each end keeps a focused control's ring (2px at +2) whole against the head and the foot. */
padding-block: var(--basalt-space-1-5);
}
@@ -5765,7 +5829,8 @@
.basalt-sheet-foot {
box-sizing: border-box;
flex: none;
- padding: var(--basalt-space-4) max(var(--basalt-space-5), env(safe-area-inset-right)) max(var(--basalt-space-5), env(safe-area-inset-bottom)) max(var(--basalt-space-5), env(safe-area-inset-left));
+ padding-block: var(--basalt-space-4) max(var(--basalt-space-5), env(safe-area-inset-bottom));
+ padding-inline: max(var(--basalt-space-5), var(--_inset-start)) max(var(--basalt-space-5), var(--_inset-end));
border-top: var(--basalt-size-hairline) solid var(--basalt-border-divider);
}
@@ -6641,7 +6706,7 @@
width: 100%;
max-width: var(--basalt-size-page-width);
margin-inline: auto;
- padding-inline: var(--_pad-left) var(--_pad-right);
+ padding-inline: var(--_pad-start) var(--_pad-end);
}
/* The rhythm: sections are one section gap apart, the first starts half a gap below the bar and the page ends a gap above its footer.
No section is given the window's height, so the widest empty band on a page is one gap. */
@@ -7307,7 +7372,7 @@
/* The sources button is a ghost sm Button (28, radius 6) with no open look of its own (DECISIONS 167, Q9b): the open state is aria-expanded and the drawer it opens. */
/* stylelint-disable-next-line unit-disallowed-list -- size-breakpoint-md (720px): a media query cannot read a token; below it the bar is fixed at the foot */
@media (width < 720px) {
- .basalt-status-bar { position: fixed; inset-inline: 0; bottom: 0; z-index: var(--basalt-layer-sticky); padding-block-end: var(--_inset-bottom); padding-inline: max(var(--basalt-gutter), var(--_inset-left)) max(var(--basalt-gutter), var(--_inset-right)); min-height: calc(var(--basalt-size-tab-bar) + var(--_inset-bottom)); gap: var(--basalt-space-2); }
+ .basalt-status-bar { position: fixed; inset-inline: 0; bottom: 0; z-index: var(--basalt-layer-sticky); padding-block-end: var(--_inset-bottom); padding-inline: max(var(--basalt-gutter), var(--_inset-start)) max(var(--basalt-gutter), var(--_inset-end)); min-height: calc(var(--basalt-size-tab-bar) + var(--_inset-bottom)); gap: var(--basalt-space-2); }
.basalt-status-bar-sources { margin-inline-start: auto; }
/* The message is stacked above the bar, out of flow, so a message coming and going moves nothing. */
.basalt-status-bar-message { position: absolute; inset-inline: 0; bottom: calc(100% + var(--basalt-size-hairline)); justify-content: flex-start; padding: var(--basalt-space-2) var(--basalt-gutter); border-top: var(--basalt-size-hairline) solid var(--basalt-border-divider); background: var(--basalt-surface-page); white-space: normal; }
@@ -7931,13 +7996,14 @@
overflow-y: auto;
overscroll-behavior: contain;
/* The home indicator's safe area is the foot's to keep where no tab bar holds it. */
- padding: var(--basalt-space-3) var(--_pad-right) max(var(--basalt-space-3), calc(var(--_inset-bottom) - var(--basalt-bottom-offset))) var(--_pad-left);
+ padding-block: var(--basalt-space-3) max(var(--basalt-space-3), calc(var(--_inset-bottom) - var(--basalt-bottom-offset)));
+ padding-inline: var(--_pad-start) var(--_pad-end);
border-top: var(--basalt-size-hairline) solid var(--basalt-border-divider);
background: var(--basalt-surface-page);
color: var(--basalt-text-primary);
font-family: var(--basalt-font-family-sans);
}
- .basalt-app-foot > * { flex: none; box-sizing: border-box; width: 100%; max-width: calc(var(--basalt-size-page-width) - var(--_pad-left) - var(--_pad-right)); min-width: 0; }
+ .basalt-app-foot > * { flex: none; box-sizing: border-box; width: 100%; max-width: calc(var(--basalt-size-page-width) - var(--_pad-start) - var(--_pad-end)); min-width: 0; }
.basalt-app-foot > .basalt-tray { flex: 0 1 auto; min-height: var(--basalt-size-tap-min); overflow-y: auto; overscroll-behavior: contain; }
@media print { .basalt-app-foot { position: static; max-height: none; overflow: visible; } }
@media (forced-colors: active) { .basalt-app-foot { border-top-color: CanvasText; } }
diff --git a/tools/html-skill/src/core.css b/tools/html-skill/src/core.css
index 370b10bd..ea5b673f 100644
--- a/tools/html-skill/src/core.css
+++ b/tools/html-skill/src/core.css
@@ -75,6 +75,10 @@
/* The row's inline padding: size-gutter, or size-gutter-narrow under the medium breakpoint (foundations, "Layout"). Apps and bars use this one. */
:root { accent-color: var(--basalt-action-primary); --basalt-gutter: var(--basalt-size-gutter); }
+ /* The side safe areas by direction (DECISIONS 336): start and end are left and right, swapped right to left, so a bar, a sheet or a toast
+ pads the side its inset is on. Read only through start and end. */
+ :root { --bh-inset-left: env(safe-area-inset-left, var(--basalt-space-0)); --bh-inset-right: env(safe-area-inset-right, var(--basalt-space-0)); --bh-inset-start: var(--bh-inset-left); --bh-inset-end: var(--bh-inset-right); }
+ :root:dir(rtl) { --bh-inset-start: var(--bh-inset-right); --bh-inset-end: var(--bh-inset-left); }
@media (width < %bp-md%) { :root { --basalt-gutter: var(--basalt-size-gutter-narrow); } }
a, button, summary, [role="tab"], .row, .disclosure, .segment button { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
@@ -263,8 +267,26 @@
/* stylelint-disable-next-line unit-disallowed-list -- the ring's 1.5px stroke; no token */
.btn[aria-busy="true"]::after { content: ""; position: absolute; inset: 0; margin: auto; width: var(--basalt-size-icon-sm); height: var(--basalt-size-icon-sm); border: 1.5px solid color-mix(in oklch, currentColor 25%, transparent); border-top-color: currentColor; border-radius: var(--basalt-radius-full); animation: bh-spin var(--basalt-duration-loop-ring) linear infinite; }
.btn svg { flex: none; }
- /* Radius follows the box as it is drawn (decision 138, E1): a button is at least 44 on touch, so it is radius 8, as every control that size is. */
- @media (pointer: coarse), (width < %bp-md%) { .btn { min-height: var(--basalt-size-tap-min); border-radius: var(--basalt-radius-md); } .btn[data-icon-only] { min-width: var(--basalt-size-tap-min); } }
+ /* A ghost control at an edge (DECISIONS 336), React's `edge`: `data-edge="start"` or `"end"` puts its glyph or words on the head's line and
+ hangs its box into the padding by its inset (its padding with words; half its drawn size less its glyph, icon-only), only into the room
+ its head declares (`--basalt-edge-room`, `-start`, `-end`; none when it declares nothing). The ring is +2 where 4 of room is left, else -2. */
+ .btn { --_drawn: var(--_h); --_glyph: var(--basalt-size-icon-sm); }
+ .btn[data-variant="ghost"][data-edge] { --_inset: var(--_px); }
+ .btn[data-variant="ghost"][data-icon-only][data-edge] { --_inset: calc((var(--_drawn) - var(--_glyph)) / 2); }
+ .btn[data-variant="ghost"][data-edge="start"] { --_hang: min(var(--_inset), var(--basalt-edge-room-start, var(--basalt-edge-room, var(--basalt-space-0)))); margin-inline-start: calc(-1 * var(--_hang)); }
+ .btn[data-variant="ghost"][data-edge="end"] { --_hang: min(var(--_inset), var(--basalt-edge-room-end, var(--basalt-edge-room, var(--basalt-space-0)))); margin-inline-end: calc(-1 * var(--_hang)); }
+ .btn[data-variant="ghost"][data-edge="start"]:focus-visible { outline-offset: clamp(calc(-1 * var(--basalt-size-focus-width)), calc((var(--basalt-edge-room-start, var(--basalt-edge-room, calc(var(--_hang) + var(--basalt-size-tap-min)))) - var(--_hang) - var(--basalt-size-focus-offset) - var(--basalt-size-focus-width)) * 999 + var(--basalt-size-focus-offset)), var(--basalt-size-focus-offset)); }
+ .btn[data-variant="ghost"][data-edge="end"]:focus-visible { outline-offset: clamp(calc(-1 * var(--basalt-size-focus-width)), calc((var(--basalt-edge-room-end, var(--basalt-edge-room, calc(var(--_hang) + var(--basalt-size-tap-min)))) - var(--_hang) - var(--basalt-size-focus-offset) - var(--basalt-size-focus-width)) * 999 + var(--basalt-size-focus-offset)), var(--basalt-size-focus-offset)); }
+ /* Radius follows the box as it is drawn (decision 138, E1): a button is at least 44 on touch, so it is radius 8, as every control that size is.
+ A hung .btn with words keeps its own width there and takes what it lacks of 44 as hit area (46, so the press's .98 keeps 45.08). */
+ @media (pointer: coarse), (width < %bp-md%) {
+ .btn { min-height: var(--basalt-size-tap-min); border-radius: var(--basalt-radius-md); --_drawn: max(var(--_h), var(--basalt-size-tap-min)); }
+ .btn[data-icon-only] { min-width: var(--basalt-size-tap-min); }
+ .btn[data-variant="ghost"][data-edge]:not([data-icon-only]) { min-width: 0; --_miss: max(var(--basalt-space-0), calc(var(--basalt-size-tap-min) + 2 * var(--basalt-size-hairline) - 100%)); }
+ .btn[data-variant="ghost"][data-edge]:not([data-icon-only])::before { content: ""; position: absolute; inset-block: min(var(--basalt-space-0), calc((100% - var(--basalt-size-tap-min)) / 2 - var(--basalt-size-hairline))); }
+ .btn[data-variant="ghost"][data-edge="end"]:not([data-icon-only])::before { --_out: min(calc(var(--_miss) / 2), calc(var(--basalt-edge-room-end, var(--basalt-edge-room, var(--basalt-space-0))) - var(--_hang))); inset-inline: calc(var(--_out) - var(--_miss)) calc(-1 * var(--_out)); }
+ .btn[data-variant="ghost"][data-edge="start"]:not([data-icon-only])::before { --_out: min(calc(var(--_miss) / 2), calc(var(--basalt-edge-room-start, var(--basalt-edge-room, var(--basalt-space-0))) - var(--_hang))); inset-inline: calc(-1 * var(--_out)) calc(var(--_out) - var(--_miss)); }
+ }
/* A link on its own is a touch target (44px); a link inside running text is not, so a paragraph, list item, quote, caption,
hint, `.prose` or `.small` keeps its inline links as they are. The brand, the skip link and the footer's links always count.
`.tap` opts any other link in. The negative block margin makes the link's margin box one line tall, so a linked row sits
diff --git a/tools/html-skill/src/modules/app-shell.css b/tools/html-skill/src/modules/app-shell.css
index 66a6cf31..005c8d38 100644
--- a/tools/html-skill/src/modules/app-shell.css
+++ b/tools/html-skill/src/modules/app-shell.css
@@ -63,7 +63,8 @@
box-sizing: border-box;
min-width: 0;
max-width: var(--basalt-size-page-width);
- padding: var(--basalt-space-6) var(--bh-pad-right) var(--basalt-space-16) var(--bh-pad-left);
+ padding-block: var(--basalt-space-6) var(--basalt-space-16);
+ padding-inline: var(--bh-pad-start) var(--bh-pad-end);
}
/* The header over the content column: sticky to the document, the page title (18/26 at 600), then the actions. */
@@ -74,7 +75,7 @@
gap: var(--basalt-space-2);
height: calc(var(--basalt-size-header) - var(--basalt-size-hairline));
padding-top: var(--basalt-size-hairline);
- padding-inline: var(--bh-pad-left) var(--bh-pad-right);
+ padding-inline: var(--bh-pad-start) var(--bh-pad-end);
}
.app-title {
min-width: 0;
diff --git a/tools/html-skill/src/modules/sheet.css b/tools/html-skill/src/modules/sheet.css
index b368fd19..830e9153 100644
--- a/tools/html-skill/src/modules/sheet.css
+++ b/tools/html-skill/src/modules/sheet.css
@@ -16,7 +16,8 @@
margin: 0;
height: auto;
max-height: none;
- padding: max(var(--_pad), var(--_safe-top)) max(var(--_pad), env(safe-area-inset-right, var(--basalt-space-0))) max(var(--_pad), env(safe-area-inset-bottom, var(--basalt-space-0))) max(var(--_pad), env(safe-area-inset-left, var(--basalt-space-0)));
+ padding-block: max(var(--_pad), var(--_safe-top)) max(var(--_pad), env(safe-area-inset-bottom, var(--basalt-space-0)));
+ padding-inline: max(var(--_pad), var(--bh-inset-start)) max(var(--_pad), var(--bh-inset-end));
border: 0;
border-radius: 0;
opacity: 1;
@@ -52,7 +53,7 @@
@starting-style { dialog.sheet[data-side="top"][open] { opacity: 1; transform: none; clip-path: inset(0 var(--_reach) calc(100% - var(--basalt-size-header) - var(--_safe-top)) var(--_reach)); } }
/* The band is the bar's own row, redrawn: the header's height, its line inside, and the gutter or the side safe area, whichever is larger. */
- .sheet-band { box-sizing: border-box; display: flex; align-items: center; flex: none; height: var(--basalt-size-header); padding: var(--basalt-size-hairline) max(var(--basalt-gutter), env(safe-area-inset-right, var(--basalt-space-0))) 0 max(var(--basalt-gutter), env(safe-area-inset-left, var(--basalt-space-0))); border-bottom: var(--basalt-size-hairline) solid var(--basalt-border-divider); }
+ .sheet-band { box-sizing: border-box; display: flex; align-items: center; flex: none; height: var(--basalt-size-header); padding-block: var(--basalt-size-hairline) 0; padding-inline: max(var(--basalt-gutter), var(--bh-inset-start)) max(var(--basalt-gutter), var(--bh-inset-end)); border-bottom: var(--basalt-size-hairline) solid var(--basalt-border-divider); }
/* Actions stay at the foot of the sheet, on a divider, however long the content scrolls. As React's (B5): the box reaches space-1-5 above the band it
draws, and that strip is clipped away, so a focused field right before the actions shows its whole ring at the end of the scroll; the band itself
@@ -78,26 +79,31 @@
align-items: center;
justify-content: space-between;
gap: var(--basalt-space-3);
- padding: max(var(--basalt-space-3), env(safe-area-inset-top, var(--basalt-space-0))) max(var(--basalt-space-3), env(safe-area-inset-right, var(--basalt-space-0))) var(--basalt-space-3) max(var(--basalt-space-5), env(safe-area-inset-left, var(--basalt-space-0)));
+ padding-block: max(var(--basalt-space-3), env(safe-area-inset-top, var(--basalt-space-0))) var(--basalt-space-3);
+ /* The same padding on both sides (DECISIONS 336): Close is hung at the end, its glyph on the line the title starts on; the room is the end
+ padding less the inset there, so the whole target stays clear of a notch. */
+ padding-inline: max(var(--basalt-space-5), var(--bh-inset-start)) max(var(--basalt-space-5), var(--bh-inset-end));
+ --basalt-edge-room-end: calc(max(var(--basalt-space-5), var(--bh-inset-end)) - var(--bh-inset-end));
border-bottom: var(--basalt-size-hairline) solid var(--basalt-border-divider);
}
.sheet-head-text { flex: 1; min-width: 0; }
.sheet-head .dialog-title { font: var(--basalt-font-weight-semibold) var(--basalt-text-xl-size) / var(--basalt-text-xl-line-height) var(--basalt-font-family-sans); letter-spacing: var(--basalt-text-xl-tracking); }
.sheet-head .dialog-description { margin: 0; font-size: var(--basalt-text-sm-size); line-height: var(--basalt-text-sm-line-height); color: var(--basalt-text-tertiary); }
- .sheet-close { --_h: var(--_control-44); border-radius: var(--basalt-radius-md); flex: none; }
+ .sheet-close { --_h: var(--_control-44); width: var(--_h); padding: 0; border-radius: var(--basalt-radius-md); flex: none; }
.sheet-body {
flex: 1 1 auto;
min-height: 0;
overflow-y: auto;
overscroll-behavior: contain;
- padding-inline: max(var(--basalt-space-5), env(safe-area-inset-left, var(--basalt-space-0))) max(var(--basalt-space-5), env(safe-area-inset-right, var(--basalt-space-0)));
+ padding-inline: max(var(--basalt-space-5), var(--bh-inset-start)) max(var(--basalt-space-5), var(--bh-inset-end));
/* The body clips what it scrolls: space-1-5 at each end keeps a focused control's ring (2px at +2) whole against the head and the foot (React's, B5). */
padding-block: var(--basalt-space-1-5);
}
.sheet-foot {
box-sizing: border-box;
flex: none;
- padding: var(--basalt-space-4) max(var(--basalt-space-5), env(safe-area-inset-right, var(--basalt-space-0))) max(var(--basalt-space-5), env(safe-area-inset-bottom, var(--basalt-space-0))) max(var(--basalt-space-5), env(safe-area-inset-left, var(--basalt-space-0)));
+ padding-block: var(--basalt-space-4) max(var(--basalt-space-5), env(safe-area-inset-bottom, var(--basalt-space-0)));
+ padding-inline: max(var(--basalt-space-5), var(--bh-inset-start)) max(var(--basalt-space-5), var(--bh-inset-end));
border-top: var(--basalt-size-hairline) solid var(--basalt-border-divider);
}
diff --git a/tools/html-skill/src/modules/tab-bar.css b/tools/html-skill/src/modules/tab-bar.css
index d8debb70..036ce1cb 100644
--- a/tools/html-skill/src/modules/tab-bar.css
+++ b/tools/html-skill/src/modules/tab-bar.css
@@ -10,8 +10,6 @@
--bh-inset-bottom-sim is for previews and tests only: it stands in for a home indicator where env() reads 0. */
:root {
--bh-inset-bottom: max(env(safe-area-inset-bottom, var(--basalt-space-0)), var(--bh-inset-bottom-sim, var(--basalt-space-0)));
- --bh-inset-left: env(safe-area-inset-left, var(--basalt-space-0));
- --bh-inset-right: env(safe-area-inset-right, var(--basalt-space-0));
--basalt-bottom-offset: var(--basalt-space-0);
}
@media (width < %bp-md%) {
@@ -30,7 +28,7 @@
box-sizing: border-box;
display: block;
padding-bottom: var(--bh-inset-bottom);
- padding-inline: var(--bh-inset-left) var(--bh-inset-right);
+ padding-inline: var(--bh-inset-start) var(--bh-inset-end);
border-top: var(--basalt-size-hairline) solid var(--basalt-border-hairline);
background: var(--basalt-surface-page);
color: var(--basalt-text-primary);
diff --git a/tools/html-skill/src/modules/topbar-nav.css b/tools/html-skill/src/modules/topbar-nav.css
index b622bf49..6a6e8256 100644
--- a/tools/html-skill/src/modules/topbar-nav.css
+++ b/tools/html-skill/src/modules/topbar-nav.css
@@ -92,15 +92,17 @@
.topbar-menu .sheet-band { gap: var(--basalt-space-2); }
/* The hold's row, when the bar has a loops toggle: the pressed-toggle button at the band's own gutter, natural width, 44 tall (React's .basalt-site-menu-loops). */
.topbar-menu-loops {
- padding: var(--basalt-space-2) max(var(--basalt-gutter), env(safe-area-inset-right, var(--basalt-space-0))) 0 max(var(--basalt-gutter), env(safe-area-inset-left, var(--basalt-space-0)));
+ padding-block: var(--basalt-space-2) 0;
+ padding-inline: max(var(--basalt-gutter), var(--bh-inset-start)) max(var(--basalt-gutter), var(--bh-inset-end));
}
.topbar-menu-loops .btn { --_h: var(--basalt-size-tap-min); border-radius: var(--basalt-radius-md); }
.topbar-menu .nav {
padding-block: var(--basalt-space-2);
- padding-inline: max(var(--basalt-space-1-5), env(safe-area-inset-left, var(--basalt-space-0))) max(var(--basalt-space-1-5), env(safe-area-inset-right, var(--basalt-space-0)));
+ padding-inline: max(var(--basalt-space-1-5), var(--bh-inset-start)) max(var(--basalt-space-1-5), var(--bh-inset-end));
}
.topbar-menu-foot {
- padding: var(--basalt-space-2) max(var(--basalt-gutter), env(safe-area-inset-right, var(--basalt-space-0))) max(var(--basalt-space-4), env(safe-area-inset-bottom, var(--basalt-space-0))) max(var(--basalt-gutter), env(safe-area-inset-left, var(--basalt-space-0)));
+ padding-block: var(--basalt-space-2) max(var(--basalt-space-4), env(safe-area-inset-bottom, var(--basalt-space-0)));
+ padding-inline: max(var(--basalt-gutter), var(--bh-inset-start)) max(var(--basalt-gutter), var(--bh-inset-end));
}
.topbar-menu-foot .btn {
--_h: var(--basalt-size-tap-min);
diff --git a/tools/html-skill/src/modules/topbar.css b/tools/html-skill/src/modules/topbar.css
index 6524bcd0..c82ca1e2 100644
--- a/tools/html-skill/src/modules/topbar.css
+++ b/tools/html-skill/src/modules/topbar.css
@@ -9,11 +9,9 @@
screen (viewport-fit=cover, which compose.mjs sets for a page with a tab bar or an app shell). */
:root {
--bh-inset-top: env(safe-area-inset-top, var(--basalt-space-0));
- --bh-inset-left: env(safe-area-inset-left, var(--basalt-space-0));
- --bh-inset-right: env(safe-area-inset-right, var(--basalt-space-0));
--basalt-sticky-offset: calc(var(--basalt-size-header) + var(--bh-inset-top));
- --bh-pad-left: max(var(--basalt-gutter), var(--bh-inset-left));
- --bh-pad-right: max(var(--basalt-gutter), var(--bh-inset-right));
+ --bh-pad-start: max(var(--basalt-gutter), var(--bh-inset-start));
+ --bh-pad-end: max(var(--basalt-gutter), var(--bh-inset-end));
}
/* A page with a bar keeps its scrollbar's room (a filter that shortens the page must not widen it) and scrolls anchors and focus clear of the sticky bar. */
:root:has(.topbar, .app-header) {
@@ -46,8 +44,8 @@
/* The skip link (core) with a bar: it hangs under the bar, space-2 below the bar's line, on the brand's start edge at every width (the bar's own inline padding, and
the page's centred column for a .topbar), fixed to the viewport so it covers nothing in the bar and moves nothing. Unseen until focus: clipped, not moved, so it never
shows over the bar on its way out. React's SkipLink does the same under a SiteHeader, AppHeader or .basalt-sticky-bar. */
- .skip-link { position: fixed; top: calc(var(--basalt-sticky-offset) + var(--basalt-space-2)); inset-inline-start: var(--bh-pad-left); transform: none; }
- :root:has(.topbar) .skip-link { inset-inline-start: max(var(--bh-pad-left), calc((100% - var(--basalt-size-page-width)) / 2 + var(--bh-pad-left))); }
+ .skip-link { position: fixed; top: calc(var(--basalt-sticky-offset) + var(--basalt-space-2)); inset-inline-start: var(--bh-pad-start); transform: none; }
+ :root:has(.topbar) .skip-link { inset-inline-start: max(var(--bh-pad-start), calc((100% - var(--basalt-size-page-width)) / 2 + var(--bh-pad-start))); }
.skip-link:not(:focus) { clip-path: inset(50%); }
/* Only primary and secondary ink may sit on it: tertiary is promoted to secondary. A pressed ghost button takes primary ink (on its wash). */
:is(.topbar, .app-header) :is(.faint, .necessity) { color: var(--basalt-text-secondary); }
@@ -72,7 +70,7 @@
max-width: var(--basalt-size-page-width);
margin-inline: auto;
padding-top: var(--basalt-size-hairline);
- padding-inline: var(--bh-pad-left) var(--bh-pad-right);
+ padding-inline: var(--bh-pad-start) var(--bh-pad-end);
}
/* The brand slot: the 32px header lockup (a mark, or a mark and a word) in a target at least 44 by 44. Identity, not a link of the row: no wash. The focus
@@ -145,7 +143,8 @@
width: 100%;
max-width: var(--basalt-size-page-width);
margin: var(--_above) auto 0;
- padding: 0 var(--bh-pad-right) calc(var(--basalt-space-8) + env(safe-area-inset-bottom, var(--basalt-space-0))) var(--bh-pad-left);
+ padding-block: 0 calc(var(--basalt-space-8) + env(safe-area-inset-bottom, var(--basalt-space-0)));
+ padding-inline: var(--bh-pad-start) var(--bh-pad-end);
color: var(--basalt-text-secondary);
font: var(--basalt-font-weight-regular) var(--bh-sm);
letter-spacing: var(--basalt-text-sm-tracking);
diff --git a/tools/html-skill/src/modules/type-layout.css b/tools/html-skill/src/modules/type-layout.css
index 4d9fdcc0..3e615627 100644
--- a/tools/html-skill/src/modules/type-layout.css
+++ b/tools/html-skill/src/modules/type-layout.css
@@ -86,7 +86,7 @@
width: 100%;
max-width: var(--basalt-size-page-width);
margin-inline: auto;
- padding-inline: max(var(--basalt-gutter), env(safe-area-inset-left, var(--basalt-space-0))) max(var(--basalt-gutter), env(safe-area-inset-right, var(--basalt-space-0)));
+ padding-inline: max(var(--basalt-gutter), var(--bh-inset-start)) max(var(--basalt-gutter), var(--bh-inset-end));
}
/* The rhythm: sections are one section gap apart, the first starts half a gap below the bar and the page ends a gap above its footer. */
.page-sections { display: block; padding-block-end: var(--basalt-section-gap); }
diff --git a/tools/html-skill/src/usage/dialog-form.md b/tools/html-skill/src/usage/dialog-form.md
index fa880daa..a6a45e22 100644
--- a/tools/html-skill/src/usage/dialog-form.md
+++ b/tools/html-skill/src/usage/dialog-form.md
@@ -5,7 +5,7 @@ A form or task in the center (React's `DialogContent form`): a dialog with the s
```html
diff --git a/tools/html-skill/src/usage/sheet.md b/tools/html-skill/src/usage/sheet.md
index 37db7352..c193fa9b 100644
--- a/tools/html-skill/src/usage/sheet.md
+++ b/tools/html-skill/src/usage/sheet.md
@@ -5,5 +5,5 @@ A modal side panel on the dialog's rules (`--usage dialog`): `
- {end ?
{end}
: null}
+ {end ?
{hang(end, "end")}
: null}
{message && !error && !held ? message.text : ""}{held ? "" : alert}
diff --git a/packages/react/src/styles/components.css b/packages/react/src/styles/components.css
index 9a5b2a32..77240859 100644
--- a/packages/react/src/styles/components.css
+++ b/packages/react/src/styles/components.css
@@ -1530,6 +1530,10 @@
padding-inline: var(--_pad-start) var(--_pad-end);
}
.basalt-site-bar { max-width: var(--basalt-size-page-width); margin-inline: auto; }
+ /* The bars' room for a control hung at their end (DECISIONS 336): the end padding less the end inset, so a hung Menu, Close or last ghost
+ action never reaches under a notch. The menu's trigger and Close carry data-edge; an app hangs its own last ghost action with `edge="end"`. */
+ :is(.basalt-site-header, .basalt-app-header, .basalt-site-menu-band) { --basalt-edge-room-end: calc(var(--_pad-end) - var(--_inset-end)); }
+ .basalt-site-menu-band .basalt-bar-actions > :not(:last-child) { --basalt-edge-room-end: initial; }
.basalt-app-bar { gap: var(--basalt-space-2); }
.basalt-bar-spacer { flex: 1 1 auto; }
.basalt-bar-actions { display: flex; align-items: center; flex: none; gap: var(--basalt-space-2); }
@@ -1708,6 +1712,8 @@
.basalt-site-action { display: none; }
.basalt-site-menu-trigger { display: inline-flex; }
.basalt-bar-actions { gap: var(--basalt-space-1); }
+ /* Menu is the last control shown here, so an app's tool hung at the end on a wide bar gives no room before it (DECISIONS 336). */
+ .basalt-site-bar .basalt-bar-actions:has(> .basalt-site-menu-trigger) > :not(.basalt-site-menu-trigger) { --basalt-edge-room-end: initial; }
:is(.basalt-site-header, .basalt-app-header, .basalt-site-menu-band) .basalt-button {
--_h: var(--basalt-size-tap-min);
--_radius: var(--basalt-radius-md);
@@ -2099,7 +2105,8 @@
.basalt-tabbar[data-keys] .basalt-tabbar-item:is(:hover, :active) .basalt-tabbar-glyph { background-color: transparent; }
.basalt-tabbar-item:focus-visible { outline: var(--basalt-size-focus-width) solid var(--basalt-border-focus); outline-offset: calc(-1 * var(--basalt-size-focus-width)); }
/* More's bottom sheet: a title and Close, then Nav rows. */
- .basalt-tabbar-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: var(--basalt-space-2); margin-bottom: var(--basalt-space-2); }
+ /* Close is hung at the head's end, its glyph on the sheet's line; the room is the sheet's own end padding less the end inset (DECISIONS 336). */
+ .basalt-tabbar-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: var(--basalt-space-2); margin-bottom: var(--basalt-space-2); --basalt-edge-room-end: calc(max(var(--basalt-space-6), var(--_inset-end)) - var(--_inset-end)); }
@media (forced-colors: active) {
.basalt-site-link:hover .basalt-site-pill,
@@ -2921,7 +2928,8 @@
.basalt-filter-row[data-highlighted] { color: var(--basalt-text-primary); }
.basalt-filter-row[data-highlighted]::before { background-color: var(--_plate); }
.basalt-filter-row[data-disabled] { color: var(--basalt-text-disabled); }
- .basalt-filter-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--basalt-space-3); padding: var(--basalt-space-1-5) var(--basalt-space-3); border-top: var(--basalt-size-hairline) solid var(--basalt-border-divider); margin: var(--basalt-space-0-5) calc(-1 * var(--basalt-space-1)) 0; }
+ /* The count at the foot's start and Clear at its end, on the popup's line: space-4 in, Clear hung by its padding (DECISIONS 336, S12). */
+ .basalt-filter-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--basalt-space-3); padding-block: var(--basalt-space-1-5); padding-inline: var(--basalt-space-4); --basalt-edge-room: var(--basalt-space-4); border-top: var(--basalt-size-hairline) solid var(--basalt-border-divider); margin: var(--basalt-space-0-5) calc(-1 * var(--basalt-space-1)) 0; }
.basalt-filter-foot .basalt-filter-clear { margin-inline-start: 0; }
/* The rows scroll inside the popup cap (nine 40px rows show whole), with the search band and the foot outside them. */
/* position: relative, so each row's hidden input (marked, so absolute at its place in the flow; DECISIONS 167, Q9j) is contained by the rows and scrolls with them: with the popup as its containing block the inputs made the popup itself scroll. */
@@ -3259,16 +3267,21 @@
display: flex;
align-items: center;
gap: var(--basalt-space-2);
- padding: var(--basalt-space-2-5) var(--basalt-space-2-5) var(--basalt-space-2-5) var(--basalt-space-4);
+ padding-block: var(--basalt-space-2-5);
+ padding-inline: var(--basalt-space-4);
border-bottom: var(--basalt-size-hairline) solid var(--basalt-border-divider);
}
+ /* The popup's head and foot: space-4 on both sides, Mark all as read and View all hung at the end and Clear all at the start, their words on the
+ line the title and the entries are on (DECISIONS 336). The in-page list keeps its own padding, below, and declares no room. */
+ .basalt-notifications > :is(.basalt-notifications-head, .basalt-notifications-foot) { --basalt-edge-room: var(--basalt-space-4); }
.basalt-notifications-title { margin: 0; font-size: var(--basalt-text-base-size); line-height: var(--basalt-text-base-line-height); font-weight: var(--basalt-font-weight-semibold); }
.basalt-notifications-count { flex: 1; min-width: 0; font-size: var(--basalt-text-sm-size); line-height: var(--basalt-text-sm-line-height); color: var(--basalt-text-secondary); font-variant-numeric: tabular-nums; }
.basalt-notifications-mark { flex: none; }
.basalt-notifications-foot {
display: flex;
justify-content: flex-end;
- padding: var(--basalt-space-2-5);
+ padding-block: var(--basalt-space-2-5);
+ padding-inline: var(--basalt-space-4);
border-top: var(--basalt-size-hairline) solid var(--basalt-border-divider);
}
/* Clear all at the start, View all at the end (the owner, DECISIONS 269). */
@@ -4107,6 +4120,8 @@
.basalt-code-title {
padding: var(--basalt-space-1) var(--basalt-space-4);
+ /* Its copy control hangs into the end padding, its glyph on the line the title starts on (DECISIONS 336). */
+ --basalt-edge-room: var(--basalt-space-4);
box-shadow: inset 0 calc(-1 * var(--basalt-size-hairline)) 0 var(--basalt-border-divider);
font: var(--basalt-font-weight-medium) var(--basalt-text-xs-size) / var(--basalt-text-xs-line-height) var(--basalt-font-family-sans);
color: var(--basalt-text-secondary);
@@ -4134,9 +4149,9 @@
.basalt-code-pre code { font: inherit; }
.basalt-code-pre:focus-visible { outline: var(--basalt-size-focus-width) solid var(--basalt-border-focus); outline-offset: var(--basalt-size-focus-offset); }
/* Copy sits top right: in the title row when there is one, else over the code's corner. */
- .basalt-code-copy { position: absolute; top: var(--basalt-space-1-5); right: var(--basalt-space-1-5); }
+ .basalt-code-copy { position: absolute; top: var(--basalt-space-1-5); inset-inline-end: var(--basalt-space-1-5); }
.basalt-code-title { display: flex; align-items: center; justify-content: space-between; min-height: var(--basalt-size-control-sm); }
- .basalt-code-title .basalt-code-copy { position: static; margin: calc(-1 * var(--basalt-space-1)) calc(-1 * var(--basalt-space-2-5)) calc(-1 * var(--basalt-space-1)) 0; }
+ .basalt-code-title .basalt-code-copy { position: static; margin-block: calc(-1 * var(--basalt-space-1)); margin-inline: 0; }
/* Base UI's one inline style, drawn here so a page under `style-src 'self'` can turn Base UI's style elements off (`CSPProvider disableStyleElements`) and see
the same thing: the element Base UI marks scrolls with no scrollbar. Base UI's own rule is these two declarations; with its style element on, both agree. */
@@ -4318,11 +4333,12 @@
/* Before the first line of a replay: one sentence in the log's box, in the text column. */
.basalt-terminal-hint { grid-column: 1 / -1; margin-inline-start: calc(var(--basalt-size-icon-sm) + var(--basalt-space-2)); color: var(--basalt-text-tertiary); }
.basalt-terminal-actions { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0 var(--basalt-space-2); max-width: 100%; margin-inline-start: auto; }
- .basalt-terminal-actions:has(.basalt-button) { margin-inline-end: calc(-1 * var(--basalt-space-2-5)); }
.basalt-terminal-state { display: inline-flex; font-weight: var(--basalt-font-weight-regular); }
.basalt-terminal-state [data-error] { color: var(--basalt-status-danger); }
- /* A word that changes in place is a Reserve (every form in one grid cell, the others unseen), so the cell is as wide as the widest. */
+ /* A word that changes in place is a Reserve (every form in one grid cell, the others unseen), so the cell is as wide as the widest. The state's
+ words face the buttons, so their spare room is the head's open middle; a button's words are centred in it (DECISIONS 336, R-1). */
.basalt-terminal-swap { justify-items: end; }
+ .basalt-terminal-actions .basalt-button .basalt-terminal-swap { justify-items: center; }
.basalt-terminal-swap > * { display: inline-flex; align-items: center; gap: var(--basalt-space-1-5); white-space: nowrap; }
/* A transcript whose lines arrive has a fixed height that scrolls inside, so arriving lines never move the page. */
.basalt-terminal[data-live] .basalt-code-pre { box-sizing: border-box; block-size: calc(var(--basalt-size-code-line-height) * 9 + var(--basalt-space-3) * 2); overflow-y: auto; scrollbar-gutter: stable; }
@@ -4536,8 +4552,6 @@
/* Under 480px of the Terminal's own width the figure is start-aligned, right after the state word, so the two read as one status and the seat's
spare room falls at the line's open end (ruling 12). */
.basalt-terminal-time .basalt-run-timer > .basalt-reserve { justify-items: start; }
- /* Under 480px a head with a run's time keeps its actions inside its padding (the compact copy button hangs by its own margin, below). */
- .basalt-terminal-actions:has(> .basalt-terminal-time) { margin-inline-end: 0; }
/* From 480px of its own width a head with a run's time reads title, state … time, Copy, as a card's head reads name, badge … time, controls
(DECISIONS 326, 67-5): the state follows the title space-3 after it, start-aligned in its seat; the time keeps its place space-3 before Copy,
end-aligned in its seat. Both seats' spare room is the head's own open middle. */
@@ -4549,8 +4563,6 @@
.basalt-terminal-head:has(.basalt-terminal-time) .basalt-terminal-state > .basalt-reserve { justify-items: start; }
.basalt-terminal-head:has(.basalt-terminal-time) .basalt-terminal-time { order: 2; margin-inline-start: auto; }
.basalt-terminal-head:has(.basalt-terminal-time) .basalt-terminal-time .basalt-run-timer > .basalt-reserve { justify-items: end; }
- /* "Copy commands" ends on the line every duration under it ends on: the ghost button's glyph-side padding hangs past the head's (the re-check). */
- .basalt-terminal-head:has(.basalt-terminal-time) .basalt-terminal-copy { margin-inline-end: calc(-1 * var(--basalt-space-2-5)); }
}
/* Under 480px of the Terminal's own width a head with a run's time is two rows (ruling 12): the title and the copy button (its glyph on the end
padding line), then the state and its time from the title's start edge; space-2 between the two lines, the words 15 from the head's edges. The button's row is its own height
@@ -4571,8 +4583,9 @@
}
.basalt-terminal-head:has(.basalt-terminal-time) > .basalt-terminal-actions { display: contents; }
.basalt-terminal-head:has(.basalt-terminal-time) .basalt-terminal-title { grid-area: 1 / 1 / 2 / 3; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
- /* The copy glyph on the head's inline padding line, where the title starts and every duration ends: the target hangs into the padding (14 at 44). */
- .basalt-terminal-head:has(.basalt-terminal-time) .basalt-terminal-copy-compact { grid-area: 1 / 3; justify-self: end; margin-inline-end: calc((var(--_head-button) - var(--basalt-size-icon-sm)) / -2); }
+ /* The copy glyph on the head's inline padding line, where the title starts and every duration ends: the target hangs into the padding by the
+ edge rule (6 at 28, 14 at 44). */
+ .basalt-terminal-head:has(.basalt-terminal-time) .basalt-terminal-copy-compact { grid-area: 1 / 3; justify-self: end; }
.basalt-terminal-head:has(.basalt-terminal-time) :is(.basalt-terminal-state, .basalt-terminal-time) { grid-row: 2; margin-block-start: calc(var(--basalt-space-2) - (var(--_head-button) - var(--basalt-text-xs-line-height)) / 2); }
.basalt-terminal-head:has(.basalt-terminal-time) .basalt-terminal-state { grid-column: 1; }
.basalt-terminal-head:has(.basalt-terminal-time) .basalt-terminal-state > .basalt-reserve { justify-items: start; }
@@ -5916,7 +5929,10 @@
align-items: center;
gap: var(--basalt-space-1);
margin: 0;
- padding: var(--basalt-space-2) var(--basalt-space-2) var(--basalt-space-2) var(--basalt-space-4);
+ /* space-4 on both sides (DECISIONS 336): Close is hung at the end, its glyph on the line the count and the results end on. */
+ padding-block: var(--basalt-space-2);
+ padding-inline: var(--basalt-space-4);
+ --basalt-edge-room: var(--basalt-space-4);
border-bottom: var(--basalt-size-hairline) solid var(--basalt-border-divider);
border-start-start-radius: var(--basalt-radius-lg);
border-start-end-radius: var(--basalt-radius-lg);
@@ -7363,7 +7379,7 @@
.basalt-date-age-seat { justify-items: start; }
/* ---- Status bar (D14b; V7, R6): a 44px foot from 720, fixed (56 plus the safe area) under it ---- */
- .basalt-status-bar { position: relative; box-sizing: border-box; display: flex; align-items: center; gap: var(--basalt-space-4); min-height: var(--basalt-size-tap-min); padding-inline: var(--basalt-gutter); border-top: var(--basalt-size-hairline) solid var(--basalt-border-divider); background: var(--basalt-surface-page); color: var(--basalt-text-tertiary); font: var(--basalt-font-weight-regular) var(--basalt-text-sm-size) / var(--basalt-text-sm-line-height) var(--basalt-font-family-mono); white-space: nowrap; }
+ .basalt-status-bar { position: relative; box-sizing: border-box; display: flex; align-items: center; gap: var(--basalt-space-4); min-height: var(--basalt-size-tap-min); padding-inline: var(--basalt-gutter); border-top: var(--basalt-size-hairline) solid var(--basalt-border-divider); background: var(--basalt-surface-page); color: var(--basalt-text-tertiary); font: var(--basalt-font-weight-regular) var(--basalt-text-sm-size) / var(--basalt-text-sm-line-height) var(--basalt-font-family-mono); white-space: nowrap; --basalt-edge-room: var(--basalt-gutter); }
.basalt-status-bar-start, .basalt-status-bar-sources, .basalt-status-bar-end { display: flex; flex: none; align-items: center; gap: var(--basalt-space-2); }
.basalt-status-bar-message { display: flex; flex: 1 1 0; align-items: center; justify-content: center; gap: var(--basalt-space-2); min-width: 0; min-height: var(--basalt-text-sm-line-height); margin: 0; color: var(--basalt-text-primary); }
.basalt-status-bar-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@@ -7372,8 +7388,11 @@
/* The sources button is a ghost sm Button (28, radius 6) with no open look of its own (DECISIONS 167, Q9b): the open state is aria-expanded and the drawer it opens. */
/* stylelint-disable-next-line unit-disallowed-list -- size-breakpoint-md (720px): a media query cannot read a token; below it the bar is fixed at the foot */
@media (width < 720px) {
- .basalt-status-bar { position: fixed; inset-inline: 0; bottom: 0; z-index: var(--basalt-layer-sticky); padding-block-end: var(--_inset-bottom); padding-inline: max(var(--basalt-gutter), var(--_inset-start)) max(var(--basalt-gutter), var(--_inset-end)); min-height: calc(var(--basalt-size-tab-bar) + var(--_inset-bottom)); gap: var(--basalt-space-2); }
+ .basalt-status-bar { position: fixed; inset-inline: 0; bottom: 0; z-index: var(--basalt-layer-sticky); padding-block-end: var(--_inset-bottom); padding-inline: max(var(--basalt-gutter), var(--_inset-start)) max(var(--basalt-gutter), var(--_inset-end)); min-height: calc(var(--basalt-size-tab-bar) + var(--_inset-bottom)); gap: var(--basalt-space-2);
+ --basalt-edge-room-start: calc(max(var(--basalt-gutter), var(--_inset-start)) - var(--_inset-start)); --basalt-edge-room-end: calc(max(var(--basalt-gutter), var(--_inset-end)) - var(--_inset-end)); }
.basalt-status-bar-sources { margin-inline-start: auto; }
+ /* With no sources, end follows start here and is not at the bar's end, so its last button does not hang (DECISIONS 336). */
+ .basalt-status-bar:not(:has(> .basalt-status-bar-sources)) > .basalt-status-bar-end { --basalt-edge-room: initial; --basalt-edge-room-end: initial; }
/* The message is stacked above the bar, out of flow, so a message coming and going moves nothing. */
.basalt-status-bar-message { position: absolute; inset-inline: 0; bottom: calc(100% + var(--basalt-size-hairline)); justify-content: flex-start; padding: var(--basalt-space-2) var(--basalt-gutter); border-top: var(--basalt-size-hairline) solid var(--basalt-border-divider); background: var(--basalt-surface-page); white-space: normal; }
.basalt-status-bar-message[data-empty] { display: none; }
diff --git a/packages/react/src/tab-bar.tsx b/packages/react/src/tab-bar.tsx
index 9bafbbcc..9709cc50 100644
--- a/packages/react/src/tab-bar.tsx
+++ b/packages/react/src/tab-bar.tsx
@@ -116,7 +116,7 @@ export function TabBarMore({ icon = MoreNavGlyph, label = "More", current, dot,
{label}
- } />
+ } />
{version ?
{version}
: null}
diff --git a/packages/react/src/terminal.tsx b/packages/react/src/terminal.tsx
index e2a7918d..97441901 100644
--- a/packages/react/src/terminal.tsx
+++ b/packages/react/src/terminal.tsx
@@ -5,6 +5,7 @@ import { XCircleIcon } from "@phosphor-icons/react/dist/csr/XCircle";
import * as React from "react";
import { CheckGlyph } from "./glyphs/check";
+import { CloseGlyph } from "./glyphs/close";
import { CopyGlyph } from "./glyphs/copy";
import { MinusGlyph } from "./glyphs/minus";
import { Button, IconButton } from "./button";
@@ -166,12 +167,14 @@ export function Terminal({ title, lines, prompt = "$", copyable = true, status,
// ---- copy: the commands, one per line. A replay knows every line, so it copies them all wherever its playhead is; a stream the
// app drives passes the lines that have arrived. With no command there is nothing to copy, and the button is off.
const commands = lines.filter((line) => line.kind === "command").map((line) => line.text).join("\n");
- const [copied, setCopied] = React.useState(false);
+ // What the last copy did, held for CONFIRM_MS: the words stay and the glyph says it (the check, or the close for a refused write; DECISIONS 336, Q5).
+ const [copyResult, setCopyResult] = React.useState<"copied" | "failed" | null>(null);
+ const copied = copyResult === "copied";
React.useEffect(() => {
- if (!copied) return;
- const t = setTimeout(() => setCopied(false), CONFIRM_MS);
+ if (!copyResult) return;
+ const t = setTimeout(() => setCopyResult(null), CONFIRM_MS);
return () => clearTimeout(t);
- }, [copied]);
+ }, [copyResult]);
// The compact copy glyph is one that changes (Copy, then Check): the morph's engine is on its way before the first click.
React.useEffect(() => {
if (copyable) loadFlight();
@@ -180,9 +183,10 @@ export function Terminal({ title, lines, prompt = "$", copyable = true, status,
if (!commands) return;
try {
await navigator.clipboard.writeText(commands);
- setCopied(true);
+ setCopyResult("copied");
} catch {
- // clipboard refused (insecure context or permissions): leave the button as it was
+ // clipboard refused (insecure context or permissions): the words hold and the glyph is the close for a moment
+ setCopyResult("failed");
}
};
@@ -229,18 +233,18 @@ export function Terminal({ title, lines, prompt = "$", copyable = true, status,
{words ? {words} : null}
{stages && time ? : null}
{control ? (
-
+
{swap(control.show, Object.fromEntries(control.words.map((word) => [word, word])))}
) : null}
{copyable ? (
<>
{/* Wide: the words. Narrow (the terminal's own width, under 30rem): the icon alone, with the same name. */}
-
- {swap(copied ? "Copied" : "Copy commands", { "Copy commands": "Copy commands", Copied: "Copied" })}
+
+ Copy commands
-
- {copied ? "Copied" : ""}
+
+ {copyResult === "copied" ? "Copied" : copyResult === "failed" ? "Copy failed" : ""}
>
) : null}
diff --git a/tools/html-skill/src/examples/interactive.body.html b/tools/html-skill/src/examples/interactive.body.html
index 46665a30..a946be74 100644
--- a/tools/html-skill/src/examples/interactive.body.html
+++ b/tools/html-skill/src/examples/interactive.body.html
@@ -88,7 +88,7 @@
{
"queue": {
"alertAt": 0.4,
diff --git a/tools/html-skill/src/modules/code.css b/tools/html-skill/src/modules/code.css
index 96ae4aab..4409bb40 100644
--- a/tools/html-skill/src/modules/code.css
+++ b/tools/html-skill/src/modules/code.css
@@ -6,7 +6,7 @@
.code { border-radius: var(--basalt-radius-md); background-color: var(--panel-well); font: var(--basalt-font-weight-regular) var(--bh-sm-mono); }
pre.code, .code-body { margin: 0; padding: var(--basalt-space-3) var(--basalt-space-4); overflow: auto; tab-size: 2; }
.code code { font: inherit; }
- .code-head { display: flex; align-items: center; gap: var(--basalt-space-2); min-height: var(--basalt-size-control-lg); padding: var(--basalt-space-1) var(--basalt-space-2) var(--basalt-space-1) var(--basalt-space-4); font: var(--basalt-font-weight-medium) var(--bh-xs); color: var(--basalt-text-secondary); border-bottom: var(--basalt-size-hairline) solid var(--basalt-border-divider); }
+ .code-head { display: flex; align-items: center; gap: var(--basalt-space-2); min-height: var(--basalt-size-control-lg); padding-block: var(--basalt-space-1); padding-inline: var(--basalt-space-4); --basalt-edge-room: var(--basalt-space-4); font: var(--basalt-font-weight-medium) var(--bh-xs); color: var(--basalt-text-secondary); border-bottom: var(--basalt-size-hairline) solid var(--basalt-border-divider); }
.tok-k { color: var(--basalt-syntax-keyword); }
.tok-s { color: var(--basalt-syntax-string); }
.tok-n { color: var(--basalt-syntax-constant); }
diff --git a/tools/html-skill/src/modules/copy.js b/tools/html-skill/src/modules/copy.js
index 988b70a2..75265123 100644
--- a/tools/html-skill/src/modules/copy.js
+++ b/tools/html-skill/src/modules/copy.js
@@ -87,14 +87,17 @@
var target = button.dataset.copy ? document.querySelector(button.dataset.copy) : null;
var text = button.dataset.copyText != null ? button.dataset.copyText : (target ? target.textContent : '');
copyText(text).then(function (ok) {
- button.innerHTML = (ok ? '%glyph-svg:check%' : '%glyph-svg:close%') + (iconOnly ? '' : '' + (ok ? 'Copied' : 'Copy failed') + '');
+ // A copy with a glyph and words keeps its words and changes its glyph (DECISIONS 336, Q5); the icon alone also changes its name.
+ button.innerHTML = rest[0];
+ var glyph = button.querySelector('svg, [data-glyph]');
+ if (glyph) glyph.outerHTML = ok ? '%glyph-svg:check%' : '%glyph-svg:close%';
if (iconOnly) button.setAttribute('aria-label', ok ? 'Copied' : 'Copy failed');
- announce(ok ? 'Copied to clipboard' : 'Could not copy');
+ announce(iconOnly ? (ok ? 'Copied to clipboard' : 'Could not copy') : (ok ? 'Copied' : 'Copy failed'));
clearTimeout(button.__bhTimer);
button.__bhTimer = setTimeout(function () {
button.innerHTML = rest[0];
if (iconOnly) { if (rest[1] == null) button.removeAttribute('aria-label'); else button.setAttribute('aria-label', rest[1]); }
- }, 1600);
+ }, %duration-confirm%);
});
});
});
diff --git a/tools/html-skill/src/modules/filter.css b/tools/html-skill/src/modules/filter.css
index 90a51a86..89a986e5 100644
--- a/tools/html-skill/src/modules/filter.css
+++ b/tools/html-skill/src/modules/filter.css
@@ -109,7 +109,7 @@
.filter-row[data-highlighted]::before { background-color: var(--panel-plate); transition-duration: var(--basalt-duration-instant); }
.filter-row:has(> input:disabled) { color: var(--basalt-text-disabled); }
@media (pointer: coarse), (width < %bp-md%) { .filter-row { height: max(calc(var(--_h) + 2 * var(--_inset)), var(--basalt-size-menu-row-touch)); } }
- .filter-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--basalt-space-3); padding: var(--basalt-space-1-5) var(--basalt-space-3); border-top: var(--basalt-size-hairline) solid var(--basalt-border-divider); margin: var(--basalt-space-0-5) calc(-1 * var(--basalt-space-1)) 0; }
+ .filter-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--basalt-space-3); padding-block: var(--basalt-space-1-5); padding-inline: var(--basalt-space-4); --basalt-edge-room: var(--basalt-space-4); border-top: var(--basalt-size-hairline) solid var(--basalt-border-divider); margin: var(--basalt-space-0-5) calc(-1 * var(--basalt-space-1)) 0; }
/* The rows scroll inside the popup cap (nine 40px rows show whole), with the search band and the foot outside them. */
.filter-rows { max-height: var(--basalt-size-popup-max-height); margin-inline: calc(-1 * var(--basalt-space-1)); padding-inline: var(--basalt-space-1); overflow-y: auto; overscroll-behavior: contain; }
/* The search band, from ten values: the palette band's recipe at a popup row's size. 40px, the next level's fill, a divider below, the -2 inset ring
diff --git a/tools/html-skill/src/modules/filter.js b/tools/html-skill/src/modules/filter.js
index 4ff37899..0af7186d 100644
--- a/tools/html-skill/src/modules/filter.js
+++ b/tools/html-skill/src/modules/filter.js
@@ -92,8 +92,9 @@
head.appendChild(el('span', 'filter-label', { id: id.label }, null)).textContent = label;
var count = el('span', 'filter-count', { id: id.count, 'data-reserved': '', 'data-any': 'Any', 'data-widest': opts.length + ' of ' + opts.length });
shell.value = count.appendChild(el('span', 'filter-count-value'));
- head.appendChild(count);
+ // Label, Clear, count (DECISIONS 336): Clear never moves, and the count's spare room is the row's open end.
head.appendChild(clear);
+ head.appendChild(count);
var chips = el('div', 'filter-chips', { role: 'group', 'aria-labelledby': id.label, 'aria-describedby': id.count });
opts.forEach(function (o) {
var chip = el('label', 'chip');
@@ -144,6 +145,7 @@
pop.appendChild(group);
shell.count = el('span', 'filter-count', { id: id.count });
var foot = el('div', 'filter-foot');
+ clear.setAttribute('data-edge', 'end');
foot.appendChild(shell.count);
foot.appendChild(clear);
pop.appendChild(foot);
diff --git a/tools/html-skill/src/modules/notifications.css b/tools/html-skill/src/modules/notifications.css
index 05bfb45d..a2f93875 100644
--- a/tools/html-skill/src/modules/notifications.css
+++ b/tools/html-skill/src/modules/notifications.css
@@ -8,11 +8,11 @@
.popover.notifications:popover-open { display: flex; }
/* stylelint-disable-next-line unit-disallowed-list -- a width that follows the window (a viewport unit), less the margins; a fixed-length token cannot say it */
.popover.notifications { flex-direction: column; width: min(var(--basalt-size-toast-width), calc(100vw - 2 * var(--basalt-space-4))); max-width: none; max-height: var(--available-height, 100vh); padding: 0; overflow: hidden; }
- .notifications-head { display: flex; align-items: center; gap: var(--basalt-space-2); padding: var(--basalt-space-2-5) var(--basalt-space-2-5) var(--basalt-space-2-5) var(--basalt-space-4); border-bottom: var(--basalt-size-hairline) solid var(--basalt-border-divider); }
+ .notifications-head { display: flex; align-items: center; gap: var(--basalt-space-2); padding-block: var(--basalt-space-2-5); padding-inline: var(--basalt-space-4); --basalt-edge-room: var(--basalt-space-4); border-bottom: var(--basalt-size-hairline) solid var(--basalt-border-divider); }
.notifications-title { flex: none; line-height: var(--basalt-text-base-line-height); }
.notifications-count { flex: 1; min-width: 0; font-size: var(--basalt-text-sm-size); line-height: var(--basalt-text-sm-line-height); color: var(--basalt-text-secondary); font-variant-numeric: tabular-nums; }
.notifications-mark { flex: none; }
- .notifications-foot { display: flex; justify-content: flex-end; padding: var(--basalt-space-2-5); border-top: var(--basalt-size-hairline) solid var(--basalt-border-divider); }
+ .notifications-foot { display: flex; justify-content: flex-end; padding-block: var(--basalt-space-2-5); padding-inline: var(--basalt-space-4); --basalt-edge-room: var(--basalt-space-4); border-top: var(--basalt-size-hairline) solid var(--basalt-border-divider); }
.notifications-clear { margin-inline-end: auto; }
.notifications-empty { margin: 0; padding: var(--basalt-space-6) var(--basalt-space-4); text-align: center; color: var(--basalt-text-secondary); }
/* The list keeps space-1-5 (6px) from its clipping edges, so a focusable row's ring (2px offset, 2px wide) is never cut. */
diff --git a/tools/html-skill/src/modules/notifications.js b/tools/html-skill/src/modules/notifications.js
index 34adb7c1..14479c49 100644
--- a/tools/html-skill/src/modules/notifications.js
+++ b/tools/html-skill/src/modules/notifications.js
@@ -40,7 +40,7 @@
'' + BELL + '' +
'
' +
'
' + _.esc(label) + '
' +
- 'Mark all as read
' +
+ 'Mark all as read
' +
'
Nothing yet.
' +
'
' +
'' +
@@ -54,9 +54,9 @@
var scroll = pop.querySelector('.notifications-scroll');
var list = pop.querySelector('.notifications-list');
var foot = pop.querySelector('.notifications-foot');
- foot.innerHTML = (o.onClearAll ? 'Clear all' : '') + (o.viewAllHref
- ? 'View all'
- : 'View all');
+ foot.innerHTML = (o.onClearAll ? 'Clear all' : '') + (o.viewAllHref
+ ? 'View all'
+ : 'View all');
var viewAll = foot.lastElementChild;
var clear = pop.querySelector('.notifications-clear');
var unglide;
diff --git a/tools/html-skill/src/modules/search.css b/tools/html-skill/src/modules/search.css
index b9146b74..bbef6ead 100644
--- a/tools/html-skill/src/modules/search.css
+++ b/tools/html-skill/src/modules/search.css
@@ -17,7 +17,9 @@
align-items: center;
gap: var(--basalt-space-1);
margin: 0;
- padding: var(--basalt-space-2) var(--basalt-space-2) var(--basalt-space-2) var(--basalt-space-4);
+ padding-block: var(--basalt-space-2);
+ padding-inline: var(--basalt-space-4);
+ --basalt-edge-room: var(--basalt-space-4);
border-bottom: var(--basalt-size-hairline) solid var(--basalt-border-divider);
border-start-start-radius: var(--basalt-radius-lg);
border-start-end-radius: var(--basalt-radius-lg);
diff --git a/tools/html-skill/src/modules/sheet.css b/tools/html-skill/src/modules/sheet.css
index 830e9153..e1a02197 100644
--- a/tools/html-skill/src/modules/sheet.css
+++ b/tools/html-skill/src/modules/sheet.css
@@ -53,7 +53,7 @@
@starting-style { dialog.sheet[data-side="top"][open] { opacity: 1; transform: none; clip-path: inset(0 var(--_reach) calc(100% - var(--basalt-size-header) - var(--_safe-top)) var(--_reach)); } }
/* The band is the bar's own row, redrawn: the header's height, its line inside, and the gutter or the side safe area, whichever is larger. */
- .sheet-band { box-sizing: border-box; display: flex; align-items: center; flex: none; height: var(--basalt-size-header); padding-block: var(--basalt-size-hairline) 0; padding-inline: max(var(--basalt-gutter), var(--bh-inset-start)) max(var(--basalt-gutter), var(--bh-inset-end)); border-bottom: var(--basalt-size-hairline) solid var(--basalt-border-divider); }
+ .sheet-band { box-sizing: border-box; display: flex; align-items: center; flex: none; height: var(--basalt-size-header); padding-block: var(--basalt-size-hairline) 0; padding-inline: max(var(--basalt-gutter), var(--bh-inset-start)) max(var(--basalt-gutter), var(--bh-inset-end)); --basalt-edge-room-end: calc(max(var(--basalt-gutter), var(--bh-inset-end)) - var(--bh-inset-end)); border-bottom: var(--basalt-size-hairline) solid var(--basalt-border-divider); }
/* Actions stay at the foot of the sheet, on a divider, however long the content scrolls. As React's (B5): the box reaches space-1-5 above the band it
draws, and that strip is clipped away, so a focused field right before the actions shows its whole ring at the end of the scroll; the band itself
diff --git a/tools/html-skill/src/modules/tab-bar.css b/tools/html-skill/src/modules/tab-bar.css
index 036ce1cb..63c1be51 100644
--- a/tools/html-skill/src/modules/tab-bar.css
+++ b/tools/html-skill/src/modules/tab-bar.css
@@ -121,7 +121,8 @@
.tab-bar[data-keys] .tab-bar-item:is(:hover, :active) .tab-bar-glyph { background-color: transparent; }
.tab-bar-item:focus-visible { outline: var(--basalt-size-focus-width) solid var(--basalt-border-focus); outline-offset: calc(-1 * var(--basalt-size-focus-width)); }
/* More's bottom sheet: a title and Close, then Nav rows. */
- .tab-bar-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: var(--basalt-space-2); margin-bottom: var(--basalt-space-2); }
+ /* Close is hung at the head's end, its glyph on the sheet's line; the room is the sheet's own end padding less the end inset (DECISIONS 336). */
+ .tab-bar-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: var(--basalt-space-2); margin-bottom: var(--basalt-space-2); --basalt-edge-room-end: calc(max(var(--_pad), var(--bh-inset-end)) - var(--bh-inset-end)); }
.tab-bar-sheet-head .dialog-title { margin: 0; }
@media (forced-colors: active) {
diff --git a/tools/html-skill/src/modules/terminal.css b/tools/html-skill/src/modules/terminal.css
index eb24ab73..c299b1f9 100644
--- a/tools/html-skill/src/modules/terminal.css
+++ b/tools/html-skill/src/modules/terminal.css
@@ -24,13 +24,14 @@
.terminal-hint { grid-column: 1 / -1; margin-inline-start: calc(var(--basalt-size-icon-sm) + var(--basalt-space-2)); color: var(--basalt-text-tertiary); }
.terminal-title { min-width: 0; }
.terminal-actions { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0 var(--basalt-space-2); max-width: 100%; margin-inline-start: auto; }
- .terminal-actions:has(.btn) { margin-inline-end: calc(-1 * var(--basalt-space-2-5)); }
.terminal-state { display: inline-flex; font-weight: var(--basalt-font-weight-regular); }
.terminal-state [data-error] { color: var(--basalt-status-danger); }
/* A word that changes in place stands in one grid cell with all its forms, the others hidden, so the cell is as wide as the widest and nothing beside it moves. */
.terminal-swap { display: inline-grid; }
.terminal-swap > * { grid-area: 1 / 1; justify-self: end; display: inline-flex; align-items: center; gap: var(--basalt-space-1-5); white-space: nowrap; }
.terminal-swap > :not([data-on]) { visibility: hidden; }
+ /* A button's words that change are centred in their cell (DECISIONS 336, S1); the state's face the buttons. */
+ .terminal-control .terminal-swap > * { justify-self: center; }
/* Wide: the words. Narrow (the terminal's own width, under 480px): the icon alone, with the same name. */
.terminal-actions .terminal-copy-compact { display: none; }
/* size-breakpoint-container: a container query cannot read a token, so the build writes its value here */
diff --git a/tools/html-skill/src/modules/terminal.js b/tools/html-skill/src/modules/terminal.js
index 16183399..2a592680 100644
--- a/tools/html-skill/src/modules/terminal.js
+++ b/tools/html-skill/src/modules/terminal.js
@@ -78,8 +78,9 @@
actions += '' + swap('Play', words(['Play', 'Pause', 'Resume', 'Replay'])) + '';
}
var copyDisabled = commands ? '' : ' disabled';
- actions += '' + COPY + swap('Copy commands', words(['Copy commands', 'Copied'])) + '' +
- '' + COPY + '' +
+ // The words hold and the glyph says what happened (DECISIONS 336, Q5): the check after a write, the close after a refused one.
+ actions += '' + COPY + 'Copy commands' +
+ '' + COPY + '' +
'';
head.classList.add('code-head');
head.innerHTML = '' + esc(title) + '' + actions + '';
@@ -99,7 +100,7 @@
}
var stateEl = root.querySelector('.terminal-state .terminal-swap');
var controlEl = root.querySelector('.terminal-control .terminal-swap');
- var copyEl = root.querySelector('.terminal-copy .terminal-swap');
+ var copyEl = root.querySelector('.terminal-copy');
var live = root.querySelector('.terminal-actions [role="status"]');
var compact = root.querySelector('.terminal-copy-compact');
var STATES = ['idle', 'running', 'paused', 'done', 'failed'];
@@ -140,13 +141,11 @@
function copy() {
if (!commands || !B.copyText) return;
B.copyText(commands).then(function (ok) {
- if (!ok) return;
- show(copyEl, 'Copied', ['Copy commands', 'Copied']);
- compact.innerHTML = '%glyph-svg:check%';
- compact.setAttribute('aria-label', 'Copied');
- live.textContent = 'Copied';
+ copyEl.firstElementChild.outerHTML = ok ? '%glyph-svg:check%' : '%glyph-svg:close%';
+ if (ok) { compact.innerHTML = '%glyph-svg:check%'; compact.setAttribute('aria-label', 'Copied'); }
+ live.textContent = ok ? 'Copied' : 'Copy failed';
clearTimeout(reset);
- reset = setTimeout(function () { show(copyEl, 'Copy commands', ['Copy commands', 'Copied']); compact.innerHTML = COPY; compact.setAttribute('aria-label', 'Copy commands'); live.textContent = ''; }, %duration-confirm%);
+ reset = setTimeout(function () { copyEl.firstElementChild.outerHTML = COPY; compact.innerHTML = COPY; compact.setAttribute('aria-label', 'Copy commands'); live.textContent = ''; }, %duration-confirm%);
});
}
root.querySelector('.terminal-copy').addEventListener('click', copy);
diff --git a/tools/html-skill/src/modules/topbar-nav.css b/tools/html-skill/src/modules/topbar-nav.css
index 6a6e8256..e49cc023 100644
--- a/tools/html-skill/src/modules/topbar-nav.css
+++ b/tools/html-skill/src/modules/topbar-nav.css
@@ -77,7 +77,10 @@
@media (width < %bp-md%) {
.topbar-links, .topbar-action { display: none; }
.topbar-menu-trigger { display: inline-flex; }
+ /* Menu is the last control shown here, so a tool hung at the end on a wide bar gives no room before it (DECISIONS 336). */
+ .topbar-inner:has(> .topbar-menu-trigger) > :not(.topbar-menu-trigger) { --basalt-edge-room-end: initial; }
}
+ .topbar-menu-actions > :not(:last-child) { --basalt-edge-room-end: initial; }
/* The narrow menu: a top sheet. Its band is the bar's own row, redrawn (sheet.css); its buttons are the bar's, 44 with radius 8. The list is Nav's rows with
no glyph. The foot holds the action, full width. */
diff --git a/tools/html-skill/src/modules/topbar-nav.js b/tools/html-skill/src/modules/topbar-nav.js
index c930c127..4e3bc1d4 100644
--- a/tools/html-skill/src/modules/topbar-nav.js
+++ b/tools/html-skill/src/modules/topbar-nav.js
@@ -48,7 +48,7 @@
}
// The Menu button, last in the bar.
- var trigger = el('button', 'btn topbar-menu-trigger', { type: 'button', 'data-variant': 'ghost', 'data-icon-only': '', 'aria-label': menuLabel, 'aria-expanded': 'false', 'aria-controls': id, 'data-dialog-open': '#' + id });
+ var trigger = el('button', 'btn topbar-menu-trigger', { type: 'button', 'data-variant': 'ghost', 'data-icon-only': '', 'data-edge': 'end', 'aria-label': menuLabel, 'aria-expanded': 'false', 'aria-controls': id, 'data-dialog-open': '#' + id });
trigger.innerHTML = '';
inner.appendChild(trigger);
@@ -63,7 +63,7 @@
inner.querySelectorAll('[data-tool]').forEach(function (tool) { actions.appendChild(copy(tool)); });
var toggle = inner.querySelector('[data-theme-toggle]');
if (toggle) actions.appendChild(copy(toggle));
- var close = el('button', 'btn', { type: 'button', 'data-variant': 'ghost', 'data-icon-only': '', 'aria-label': closeLabel, 'data-dialog-close': '', autofocus: '' });
+ var close = el('button', 'btn', { type: 'button', 'data-variant': 'ghost', 'data-icon-only': '', 'data-edge': 'end', 'aria-label': closeLabel, 'data-dialog-close': '', autofocus: '' });
close.innerHTML = '';
actions.appendChild(close);
band.appendChild(actions);
diff --git a/tools/html-skill/src/modules/topbar.css b/tools/html-skill/src/modules/topbar.css
index c82ca1e2..ec52ecc3 100644
--- a/tools/html-skill/src/modules/topbar.css
+++ b/tools/html-skill/src/modules/topbar.css
@@ -72,6 +72,8 @@
padding-top: var(--basalt-size-hairline);
padding-inline: var(--bh-pad-start) var(--bh-pad-end);
}
+ /* The room for a control hung at the bar's end (DECISIONS 336): the end padding less the end inset, so it never reaches under a notch. */
+ :is(.topbar, .app-header) { --basalt-edge-room-end: calc(var(--bh-pad-end) - var(--bh-inset-end)); }
/* The brand slot: the 32px header lockup (a mark, or a mark and a word) in a target at least 44 by 44. Identity, not a link of the row: no wash. The focus
ring is the control ring round the 32px lockup, +2, drawn by a box the height of the lockup. */
diff --git a/tools/html-skill/src/usage/code.md b/tools/html-skill/src/usage/code.md
index 4b25dd15..b146a6dc 100644
--- a/tools/html-skill/src/usage/code.md
+++ b/tools/html-skill/src/usage/code.md
@@ -9,4 +9,6 @@
`tabindex="0"` goes on `pre.code-body` (it scrolls), with `` inside; not on the ``.
+The head's last ghost button (Copy) takes `data-edge="end"`: its glyph or words end on the line the title starts on.
+
Tokens, only inside the ``: `.tok-k` keyword, `.tok-s` string, `.tok-n` number or constant, `.tok-f` function, `.tok-c` comment.
diff --git a/tools/html-skill/src/usage/copy.md b/tools/html-skill/src/usage/copy.md
index cc3131a2..97a30bef 100644
--- a/tools/html-skill/src/usage/copy.md
+++ b/tools/html-skill/src/usage/copy.md
@@ -1,6 +1,6 @@
# copy
-`` or `data-copy-text="…"`; keep an icon and a `` label inside.
+`` or `data-copy-text="…"`; keep an icon and a `` label inside. Its words hold: for 1500ms its glyph is the check after the copy, or the close if the clipboard refused, and the page's live region says "Copied" or "Copy failed".
`Basalt.copyText(text)` copies from script. Copy buttons are not printed.
diff --git a/tools/html-skill/src/usage/filter.md b/tools/html-skill/src/usage/filter.md
index 0253b950..04546f9d 100644
--- a/tools/html-skill/src/usage/filter.md
+++ b/tools/html-skill/src/usage/filter.md
@@ -11,7 +11,7 @@ A filter that takes any number of its values (React's MultiSelect), and the line
Showing 24 of 24 runs
```
-- Write the labelled checkboxes only. The script builds the control: up to six values are chips (a plus off, a check on) under the label, a count ("Any", "2 of 4") and Clear; seven or more, or `data-toolbar`, are a trigger and a checklist, with a search field from ten values. The count, never the window, picks the form. `data-label` names the group.
+- Write the labelled checkboxes only. The script builds the control: up to six values are chips (a plus off, a check on) under the label, Clear and a count ("Any", "2 of 4"), in that order; seven or more, or `data-toolbar`, are a trigger and a checklist, with a search field from ten values. The count, never the window, picks the form. `data-label` names the group.
- Clear stays in place and is `aria-disabled` at zero, so focus stays on it. Nothing chosen means no filter.
- `data-for` (a `table` or its `.table-wrap` by id) and `data-column` (from 1) hide the rows whose cell's `data-value`, else its words, matches no chosen value, and show the table's `tr[data-empty]` when none is left. Without them, listen for `filterchange` (`detail.values`) and filter yourself.
- `.filter-result` is the one thing spoken: shown at once, spoken once, 400ms after the text holds still. Put one by each filtered list, with `data-noun`. `Basalt.filterResult(el, text)` sets one by hand; `Basalt.refreshFilter(id)` filters again after you replace the rows.
diff --git a/tools/html-skill/src/usage/search.md b/tools/html-skill/src/usage/search.md
index b8dbc3da..06054ea6 100644
--- a/tools/html-skill/src/usage/search.md
+++ b/tools/html-skill/src/usage/search.md
@@ -8,7 +8,7 @@ A search dialog on the dialog's rules (`--usage dialog`): `