Skip to content

Commit 9b49c30

Browse files
sametbasbugclaude
andcommitted
Give spacing a rhythm unit
Seventy distinct rem values across 429 margin, padding and gap declarations -- 0.35 next to 0.38 next to 0.4, none of them chosen against the others. The scale indexes by half-pixels, so --space-8 is exactly 1rem. Steps are 2px apart below 1rem and thin out above it, which is where the old values actually clustered. A plain 4px grid was the obvious choice and the wrong one: it split neighbours like 0.35 and 0.4rem into different steps, pulling apart spacings that were meant to match. Rendered drift tops out at 3.2px on section padding; 394 of 425 values moved less than a pixel. The snapshot tool earned its keep here. The first pass emitted -var(--space-10) for negative values, which is invalid CSS -- the browser drops the whole declaration, silently. Nine negative margins had collapsed to zero, including the reply-context hanging indent, and the diff caught it as a 21.6px jump before it reached a commit. Negatives now go through calc(... * -1), and the token comment says why. Left raw: two clamp() gaps and a calc() with env(safe-area-inset-bottom), which are fluid rather than stepped, and one 0.02rem gap that is a sub-pixel nudge rather than spacing. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent fac425c commit 9b49c30

7 files changed

Lines changed: 386 additions & 353 deletions

File tree

‎scripts/orbit-style-snapshot.mjs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const THEMES = ['light', 'dark'];
3232
const GROUPS = {
3333
renk: ['color', 'backgroundColor', 'borderTopColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'outlineColor', 'boxShadow', 'backgroundImage'],
3434
tip: ['fontSize', 'fontWeight', 'letterSpacing', 'lineHeight', 'textTransform', 'fontFamily'],
35+
bosluk: ['marginTop', 'marginRight', 'marginBottom', 'marginLeft', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'rowGap', 'columnGap'],
3536
};
3637

3738
async function capture(outputPath, group) {

‎src/styles/base.css‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ main {
7272
}
7373

7474
.section-label {
75-
margin: 0 0 0.65rem;
75+
margin: 0 0 var(--space-5);
7676
color: var(--muted);
7777
font-size: var(--text-2xs);
7878
font-weight: var(--weight-bold);
@@ -82,7 +82,7 @@ main {
8282

8383
.plain-link {
8484
display: inline-block;
85-
margin-top: 1rem;
85+
margin-top: var(--space-8);
8686
color: var(--link);
8787
font-size: var(--text-sm);
8888
font-weight: var(--weight-semibold);
@@ -94,7 +94,7 @@ main {
9494
display: inline-flex;
9595
align-items: center;
9696
justify-content: center;
97-
padding: 0 1rem;
97+
padding: 0 var(--space-8);
9898
border: 1px solid var(--ink);
9999
font-size: var(--text-sm);
100100
font-weight: var(--weight-bold);
@@ -133,7 +133,7 @@ main {
133133
z-index: 100;
134134
top: 0.75rem;
135135
left: 0.75rem;
136-
padding: 0.7rem 0.9rem;
136+
padding: var(--space-6) var(--space-7);
137137
border-radius: 0.7rem;
138138
color: #fff;
139139
background: #27345f;

0 commit comments

Comments
 (0)