Repository navigation
Put font sizes and corner radii on scales - #47
vivecuervo7 wants to merge 4 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
a8ce85a to
bab526c
Compare
vivecuervo7
left a comment
There was a problem hiding this comment.
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.
| @@ -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); | |||
There was a problem hiding this comment.
[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.
There was a problem hiding this comment.
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.
| width: 7px; | ||
| height: 7px; | ||
| border-radius: 4px; | ||
| border-radius: var(--radius-sm); |
There was a problem hiding this comment.
[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×7HiddenMarks.svelte:91:.unread, 7×7routes/stats/+page.svelte:488:.split, 8px tallstats/GapReport.svelte:62:.bar, 8px tall
All five should probably be var(--radius-full).
There was a problem hiding this comment.
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.
| 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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Fixed in 8fa25ee, as in Segmented.svelte: the buttons use calc(var(--radius-md) - 2px) inside the box's --radius-md.
…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>
What
Font sizes and corner radii come from scales in
app.cssinstead of being written per component: ten text sizes (--text-xsto--text-5xl) in place of 20, and six radii (--radius-xsto--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-fullso it stays one.xs11.5xs2sm12.5sm4base13md8md14lg12lg15xl20xl18full2xl223xl264xl325xl38Before and after, from
mainand this branch on the same data:🤖 Generated with Claude Code