Skip to content

Put font sizes and corner radii on scales - #47

Open
vivecuervo7 wants to merge 4 commits into
mainfrom
css-scales
Open

vivecuervo7 wants to merge 4 commits into
mainfrom
css-scales

Conversation

@vivecuervo7

@vivecuervo7 vivecuervo7 commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

What

Font sizes and corner radii come from scales in app.css instead of being written per component: ten text sizes (--text-xs to --text-5xl) in place of 20, and six radii (--radius-xs to --radius-full) in place of 16. One commit for the radii, one for the type.

Why

Stacked on the colour refactor. The sizes had drifted in half-pixel steps (12, 12.5, 13, 13.5, 14, 14.5…) and the radii likewise, without anyone choosing them; a scale makes the next size a choice between a few, and gives the look one place to tune.

How

Each value went to the step nearest it, rounding up on a tie, so text only ever got the same or half a pixel larger. A radius that made something a pill or a circle (half its height) became --radius-full so it stays one.

Text → Uses Radius → Uses
11, 11.5 xs 11.5 21 1, 2 xs 2 7
12, 12.5 sm 12.5 81 3, 4, 5 sm 4 10
13 base 13 65 6, 7, 8, 9 md 8 26
13.5, 14 md 14 80 10, 11, 12, 14 lg 12 52
14.5, 15, 15.5 lg 15 34 16, 20 xl 20 3
17, 19 xl 18 2 999 and pills full 15
21, 22 2xl 22 7
24, 26 3xl 26 4
30, 32 4xl 32 5
38, 40 5xl 38 7

Before and after, from main and this branch on the same data:

Start The model menu Settings Settings: Models and Personas A confirm dialog A PR's overview The panel's menu GitHub threads A thread A slice Folded lines and finding marks A finding's popover Files Wrap up Post Stats Getting started

🤖 Generated with Claude Code

@vivecuervo7
vivecuervo7 added this pull request to stack #49 November 8, 2026 00:22
Base automatically changed from css-colours to main November 11, 2026 22:44
vivecuervo7 and others added 2 commits November 12, 2026 08:44
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@vivecuervo7 vivecuervo7 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The token swap looks consistent, and nothing renders wrong today. My two comments are about places where the mapping doesn't hold up if the scale changes: a few circles and pills were mapped to fixed radius steps instead of --radius-full, and the nested segmented controls no longer have matching corners.

Comment on lines 47 to +84
@@ -55,11 +55,11 @@
height: 30px;
padding: 0 14px;
border: 0;
border-radius: 8px;
border-radius: var(--radius-md);
background: none;
color: var(--muted);
font: inherit;
font-size: 13px;
font-size: var(--text-base);
font-weight: 500;
cursor: pointer;
}
@@ -75,12 +75,12 @@
cursor: default;
}
.small {
border-radius: 9px;
border-radius: var(--radius-md);
}
.small button {
height: 26px;
padding: 0 11px;
border-radius: 7px;
font-size: 12.5px;
border-radius: var(--radius-md);
font-size: var(--text-sm);

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Nit] Nested radii no longer match.

The track has padding: 2px. Each button's radius used to be the track's minus 2 (10/8, and 9/7 for .small), so the 2px gap stayed even around the corners. Now the default track is --radius-lg (12) around --radius-md (8) buttons, so the gap gets wider at the corners. .small uses --radius-md (8) for both, so the inner corners are as round as the outer ones and the gap gets narrower there. Every segmented control shows this.

If the old look was deliberate, you could keep it and still use the scale: put calc(<outer> - 2px) (e.g. calc(var(--radius-md) - 2px)) on the inner element, or pick outer and inner steps that differ by the padding.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 8fa25ee: each button's corner is now the track's less the 2px padding, calc(var(--radius-lg) - 2px) by default and calc(var(--radius-md) - 2px) for .small, so the gap stays even round the corners whatever the scale values become.

Comment thread web/src/lib/features/reading/Pin.svelte Outdated
width: 7px;
height: 7px;
border-radius: 4px;
border-radius: var(--radius-sm);

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Minor] Circle mapped to --radius-sm instead of --radius-full.

This unread dot is 7×7 with a 4px radius, so it's a circle. The PR says a radius that made something a pill or a circle became --radius-full, but this one went to --radius-sm. It looks the same today. If --radius-sm is ever tuned below 3.5px, though, the dot turns into a rounded square.

The same thing happens in four other places:

  • SliceRail.svelte:120: .unread, 7×7
  • HiddenMarks.svelte:91: .unread, 7×7
  • routes/stats/+page.svelte:488: .split, 8px tall
  • stats/GapReport.svelte:62: .bar, 8px tall

All five should probably be var(--radius-full).

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 21dc4c6: all five are var(--radius-full). A scan for the same pattern (a radius step at least half the element's size) found one more, the 7×7 .notice dot in FileHeader.svelte, now fixed too.

Comment thread web/src/lib/ui/KeepSkip.svelte Outdated
Comment on lines +24 to +31
border-radius: var(--radius-md);
box-shadow: inset 0 0 0 1px var(--line-2);
}
button {
height: 28px;
padding: 0 12px;
border: 0;
border-radius: 7px;
border-radius: var(--radius-md);

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same nested-radius mismatch as in Segmented.svelte: this went from 9/7 to 8/8 across 2px of padding, so the corners no longer match. calc(var(--radius-md) - 2px) on the inner element would fix it.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 8fa25ee, as in Segmented.svelte: the buttons use calc(var(--radius-md) - 2px) inside the box's --radius-md.

vivecuervo7 and others added 2 commits November 13, 2026 05:12
…inner corner is the outer less the padding

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cle should be

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant