Building a resilient CSS architecture with container queries
A practical pattern for component-level breakpoints, fallback layering, and testing responsive behavior without coupling every decision to the viewport.
A practical pattern for component-level breakpoints, fallback layering, and testing responsive behavior without coupling every decision to the viewport.
| Change | Before | After | Principle |
|---|---|---|---|
| Reading decision | Title and engagement sit close together; read time is not visible until later context | Series and read-time sit in the cover, so effort and topic are known before scanning the title | operating-principles §2 (context that changes a decision) |
| Title hierarchy | Large title works, but the card lacks a summary bridge between title and tags | Title remains dominant; excerpt adds enough semantic detail to qualify the click | operating-principles §1 (primary focal point); rules/14-landing-pages.md (specific value before CTA) |
| Tags | Inline hashtag links blend into body chrome and have limited hit area | Bordered tag chips with hover state and clearer secondary weight | quality-gates Gate 4 (hover state); operating-principles §7 (touch target clarity) |
| Save action | Small icon button is visually quiet and shares the baseline with stats | 44×44px bookmark button with border, hover tint, and focus ring | operating-principles §7 (Fitts); quality-gates Gate 4 (focus/hover states) |
| Engagement row | Reactions and comments are present; saves are only implied through the icon | Reactions, comments, and saves are explicit in one footer band | operating-principles §2 (one zone for secondary metadata) |
| Dark mode | Hardcoded DEV neutrals are preserved as a faithful light-only reference | OKLCH tokens control card, text, tags, footer, and bookmark states | quality-gates Gate 6 (dark mode required) |
| Token | Light | Dark | Used for |
|---|---|---|---|
| --color-bg | oklch(96% 0.004 258) | oklch(13% 0.010 258) | Page background, skeleton midpoint |
| --color-surface | oklch(100% 0 0) | oklch(17% 0.010 258) | Article card background and footer base |
| --color-border | oklch(90% 0.006 258) | oklch(26% 0.010 258) | Card border, tag borders, bookmark outline |
| --color-text | oklch(17% 0.012 258) | oklch(94% 0.004 258) | Title and author name |
| --color-text-secondary | oklch(42% 0.012 258) | oklch(72% 0.008 258) | Excerpt and body copy |
| --color-text-muted | oklch(60% 0.008 258) | oklch(55% 0.006 258) | Date, tags, engagement stats, bookmark icon |
| --color-accent | oklch(52% 0.20 258) | oklch(65% 0.20 258) | Title hover, tag hover, bookmark hover, focus rings |
| --color-success | oklch(45% 0.15 145) | oklch(70% 0.12 145) | Author avatar badge |