diff --git a/app/src/components/onboarding/onboarding-frame.tsx b/app/src/components/onboarding/onboarding-frame.tsx
index d4502ef75b..c2457538dd 100644
--- a/app/src/components/onboarding/onboarding-frame.tsx
+++ b/app/src/components/onboarding/onboarding-frame.tsx
@@ -100,7 +100,7 @@ export function OnboardingFrame({
// Pills on a phone, as onboarding's buttons were; from `lg` the button's own corner, as on every
// other screen.
const shape =
- "h-[52px] w-full rounded-full px-5 text-sm font-semibold lg:h-10 lg:w-auto lg:min-w-32 lg:rounded-md";
+ "h-[52px] w-full rounded-full px-5 lg:h-10 lg:w-auto lg:min-w-32 lg:rounded-md";
return (
{
expect(lg).toEqual([]);
});
+ test("a button has one corner at every size, so a split button keeps its squared sides", () => {
+ const corners = classes(source("button.tsx")).filter((name) =>
+ /(^|:)rounded(-|$)/.test(name),
+ );
+ expect(corners).toEqual(["rounded-md"]);
+ });
+
+ test("a button's label is semibold", () => {
+ const weights = classes(source("button.tsx")).filter((name) =>
+ /(^|:)font-(?!mono|sans|serif)/.test(name),
+ );
+ expect(weights).toEqual(["font-semibold"]);
+ });
+
+ test("a button's keyboard focus is a solid ring in --ring, whatever the variant", () => {
+ const focus = classes(source("button.tsx")).filter((name) =>
+ name.startsWith("focus-visible:"),
+ );
+ expect(focus).toContain("focus-visible:ring-ring");
+ expect(focus).toContain("focus-visible:border-ring");
+ // Half strength is under the 3:1 a focus ring needs, and a variant's own color is weaker still.
+ expect(
+ focus.filter((name) => /:(ring|border)-(?!ring$|3$)/.test(name)),
+ ).toEqual([]);
+ });
+
test("a pressed control on a surface is raised: shadow-xs", () => {
const outline =
/outline:\s*"([^"]*)"/.exec(source("button.tsx"))?.[1] ?? "";
diff --git a/docs/app-guidelines.md b/docs/app-guidelines.md
index dc973e180f..9c4a07bb04 100644
--- a/docs/app-guidelines.md
+++ b/docs/app-guidelines.md
@@ -358,9 +358,9 @@ changes, for every screen at once, in a change agreed first.
1. **Colors.** Only the scheme's tokens, as above.
2. **Type.** Figtree on Tailwind's own type scale, in whole pixels: `text-xs` is 12px, `text-sm`
14px, `text-base` 16px and a page title's `text-2xl` 24px. Controls, rows and navigation are
- `text-sm`; labels, times and counts are `text-xs`. The line under a row's name
- (`ItemDescription`) is `text-sm` too, in `muted-foreground`: the name's weight and color set it
- apart. No text size written by hand (`text-[13px]`).
+ `text-sm`; labels, times and counts are `text-xs`. A button's label is semibold. The line under
+ a row's name (`ItemDescription`) is `text-sm` too, in `muted-foreground`: the name's weight and
+ color set it apart. No text size written by hand (`text-[13px]`).
3. **Corners.** All from `--radius`, 10px, the design's radius base. Controls are `rounded-md`
(8px), cards and the page's panel `rounded-lg` (10px), menus, dialogs and the message box
`rounded-xl` (14px), round things `rounded-full`. `rounded-none` squares a part off. No other
diff --git a/docs/design-system.md b/docs/design-system.md
index 08ae60b509..0e79f2c29d 100644
--- a/docs/design-system.md
+++ b/docs/design-system.md
@@ -96,7 +96,8 @@ changed in `tokens/src/scheme.ts` and written out with `bun run tokens:generate`
`--spacing-menu-item-x`, not `--radius-card`. A stock shadcn theme doesn't set them, so they stay
at our values while everything else changes, and the theme is broken. A state is made from the
tokens there are, as shadcn does it: hover is `hover:bg-primary/80` or `hover:bg-muted`, disabled
- is `disabled:opacity-50`, focus is `ring-ring/50`, invalid is `destructive`.
+ is `disabled:opacity-50`, focus is a ring in `ring` (a button's is solid: see
+ [Primitives](#primitives)), invalid is `destructive`.
- **A token is a token wherever it is declared.** `:root`, `.dark`, `@theme` or a component's own
stylesheet: the rules above hold for all of them. The test reads only `:root` and `.dark`; the
rule is wider than the test.
@@ -118,11 +119,13 @@ changed in `tokens/src/scheme.ts` and written out with `bun run tokens:generate`
`data-slot` on each part, `cn` for the classes. Check shadcn first: badge, radio group, kbd and
the like are already there.
- **A variant or a size keeps its meaning.** `default`, `secondary`, `outline`, `ghost`,
- `destructive` and `link`, and `xs`, `sm`, `default` and `lg`, look and measure as they do today
- and as a shadcn user expects. Moving `sm` by 4px, or making every button a pill, redraws every
- screen at once. A new look is a new variant, agreed first. A size of our own goes beside
- shadcn's, never in place of one: `SidebarMenuButton`'s `page` (36px) is for a page's own menu,
- Settings and Admin, and the app's main sidebar keeps `default` (32px).
+ `destructive` and `link`, and `xs`, `sm`, `default` and `lg`, measure as they do today and as a
+ shadcn user expects, and keep their colors and corners. Moving `sm` by 4px, or making every
+ button a pill, redraws every screen at once. A new look is a new variant, agreed first. A size
+ of our own goes beside shadcn's, never in place of one: `SidebarMenuButton`'s `page` (36px) is
+ for a page's own menu, Settings and Admin, and the app's main sidebar keeps `default` (32px).
+- **A button's label is semibold,** and its keyboard focus is a solid ring in `ring`, drawn
+ outside it, the same on every variant. Its corner is a control's, `rounded-md`, from `--radius`.
- **One system.** No second kit beside the first, no "legacy" mode, no variant that switches
between two looks. A skin keeps its own layout and wears the scheme's colors: it sets none of
them under `:root[data-skin]`, and each color role of its own reads the scheme's token that means
diff --git a/tokens/tests/contrast.test.ts b/tokens/tests/contrast.test.ts
index 6257a273fe..bee6b298e9 100644
--- a/tokens/tests/contrast.test.ts
+++ b/tokens/tests/contrast.test.ts
@@ -38,6 +38,9 @@ const PAIRS: [Token, Token[], number][] = [
["sidebar-accent-foreground", ["sidebar-accent", "sidebar"], TEXT],
["ring", ["background"], NON_TEXT],
["ring", ["card"], NON_TEXT],
+ // A button's ring is drawn outside it, on whatever it stands on: a dialog, a muted row.
+ ["ring", ["popover"], NON_TEXT],
+ ["ring", ["muted"], NON_TEXT],
["sidebar-ring", ["sidebar"], NON_TEXT],
];