The proposed CSS maintains 100% backward compatibility while adding systematic improvements and better organization.
Before:
:root {
--color-100: #141f0a;
--color-70: #000000;
--color-30: #d5d5d5;
--column-width: 55rem;
/* ... */
}
After:
:root {
/* Colors - Semantic naming */
--color-text: #141f0a;
--color-text-secondary: #374d21;
--color-text-muted: #000000;
--color-border: #d5d5d5;
--color-surface: #FAF9F7;
--color-canvas: #FFFEFC;
/* Legacy aliases - backward compatibility */
--color-100: var(--color-text);
--color-70: var(--color-text-muted);
--color-30: var(--color-border);
/* ... */
/* Spacing Scale - Systematic */
--space-3xs: 0.25rem; /* 4px */
--space-2xs: 0.5rem; /* 8px */
--space-xs: 0.75rem; /* 12px */
--space-s: 1rem; /* 16px */
--space-m: 1.5rem; /* 24px */
--space-l: 2rem; /* 32px */
--space-xl: 2.5rem; /* 40px */
--space-2xl: 3rem; /* 48px */
--space-3xl: 4rem; /* 64px */
--space-4xl: 5rem; /* 80px */
--space-5xl: 6rem; /* 96px */
--space-6xl: 8rem; /* 128px */
/* Breakpoints - Consolidated */
--bp-sm: 40rem; /* 640px */
--bp-md: 60rem; /* 960px */
--bp-lg: 80rem; /* 1280px */
}
What this means:
Before:
body {
line-height: 1.5rem; /* Breaks when font size changes */
}
h1 {
line-height: 2rem; /* Fixed pixel value */
}
After:
body {
line-height: 1.5; /* Unitless - scales naturally */
}
h1 {
line-height: 1.2; /* Scales with font size */
}
Why this matters: When users zoom text or base font changes, line-heights now scale proportionally instead of breaking layout.
Before:
Only had .stack-xs, .stack-s, .stack-m, .stack-l
After:
Added modern .flow-* classes while keeping .stack-* for compatibility:
/* New - systematic naming */
.flow > * + * { margin-top: var(--space-m); }
.flow-tight > * + * { margin-top: var(--space-2xs); }
.flow-s > * + * { margin-top: var(--space-s); }
.flow-l > * + * { margin-top: var(--space-l); }
/* Legacy - still work identically */
.stack-xs > * + * { margin-top: var(--space-2xs); }
.stack-s > * + * { margin-top: var(--space-s); }
.stack-m > * + * { margin-top: var(--space-m); }
.stack-l > * + * { margin-top: var(--space-l); }
Before:
header > div {
padding-top: 1rem;
column-gap: 2.5rem;
}
.main {
padding-top: 2rem;
padding-bottom: 8rem;
}
After:
header > div {
padding-top: var(--space-s);
column-gap: var(--space-xl);
}
.main {
padding-top: var(--space-l);
padding-bottom: var(--space-6xl);
}
Why this matters: Systematic spacing creates visual consistency and makes it easier to adjust spacing globally.
Before: Scattered throughout CSS:
400px480px640px700pxAfter: Three systematic breakpoints:
@media screen and (min-width: 40rem) { /* 640px - tablet */ }
@media screen and (min-width: 60rem) { /* 960px - desktop */ }
@media screen and (min-width: 80rem) { /* 1280px - large */ }
Old breakpoints still work - just consolidated new ones to standard values.
Before: CSS rules somewhat scattered
After: Organized into clear sections:
Before:
:focus-visible {
outline-offset: 0.1em; /* Too tight */
}
After:
:focus-visible {
outline-offset: 0.25em; /* More visible */
}
Before:
.card {
padding: 2.5rem 1rem;
}
.bio {
padding-block: 1rem;
}
After:
.card {
padding: var(--space-xl) var(--space-s);
}
.bio {
padding-block: var(--space-s);
}
.stack-xs, .stack-s, .stack-m, .stack-l - unchanged.card, .button, .grid - identical behavior.container, .main - same layoutclamp(100%, 2vw, 137.5%))<!-- In base.liquid -->
<link rel="stylesheet" href="/css/main-proposed.css" />
Everything works immediately - no HTML changes needed.
As you create new components, you can use modern syntax:
Old style (still works):
<div class="stack-m">
New style (clearer intent):
<div class="flow">
Old colors (still work):
color: var(--color-100);
New colors (clearer meaning):
color: var(--color-text);
Why larger?
.flow-* classes (kept .stack-* for compatibility)--space-* scaleWorth it? Yes - better maintainability, clearer intent, systematic design.
| Aspect | Before | After | Breaking? |
|---|---|---|---|
| Line heights | Fixed rem values |
Unitless (scales properly) | No - visually identical |
| Colors | Numeric names only | Semantic + numeric aliases | No - both work |
| Spacing | Magic numbers | Systematic variables | No - same values |
| Classes | .stack-* only |
.stack-* + .flow-* |
No - stack classes kept |
| Breakpoints | 6 arbitrary values | 3 systematic values | No - old ones remain |
| Documentation | Minimal comments | Comprehensive inline docs | N/A |
| Organization | Flat structure | Organized sections | No - just reordered |
| Focus states | 0.1em offset | 0.25em offset | No - just more visible |
Use main-proposed.css because:
To finalize:
mv css/main.css css/main-backup.css
mv css/main-proposed.css css/main.css
Then update base.liquid to use /css/main.css again.
Generated: 2025-10-08