Frontend & UI
Modern CSS and the web platform
A mental model for layout, container queries and design tokens, then letting the Popover API, anchor positioning and native dialogs replace a lot of JavaScript.
5 parts46 min readUpdated Sep 21, 2026
Parts
Part 1
A Mental Model for CSS Layout: From Normal Flow to Flexbox and GridNormal flow, block vs inline, flexbox (one dimension, content-out) vs grid (two dimensions, layout-in), intrinsic sizing, and why min-width: 0 rescues overflowing flex items — so you write layout from understanding instead of trying properties until it works.
7 min
Part 2
Container Queries and Modern Responsive Design: Components That Know Their Own WidthWhy viewport media queries fall short for reusable components, how to use container-type, named containers and cqi units, how to combine them with clamp() and :has(), plus a complete responsive card and a fallback strategy.
5 min
Part 3
Design Tokens and Theming with CSS Custom Properties: From Raw Colors to Dark ModeSplitting tokens into three tiers, naming by purpose, building light/dark themes with prefers-color-scheme plus a user override without a flash, color-scheme, mapping tokens into Tailwind v4's @theme, contrast checks and common mistakes.
7 min
Part 4
Platform First: Popover API, CSS Anchor Positioning and View Transitions Replace a Lot of UI JavaScriptIn 2026 the browser ships primitives that used to require Floating UI, Radix or an animation library. This post covers popover, invoker commands, anchor positioning and View Transitions: what they do, how to combine them, where support really stands, and where a library is still the right call.
19 min
Part 5
Accessible Modal Dialogs: Using the Native dialog Element ProperlyFrom showModal(), the top layer and ::backdrop to focus management, labelling, scroll locking, backdrop clicks and nested dialogs — plus a small React component and how to test it with a keyboard and a screen reader.
8 min
Series review
0/10 answered · 0 correct
10 questions drawn from the parts of this series. Answers here count toward each post's own quiz.
Other series
Series- AI engineering for web developers4 parts · 86 min read0/4 read
- NestJS in production3 parts · 67 min read0/3 read
- Web performance from the ground up8 parts · 74 min read0/8 read
- Frontend architecture that lasts5 parts · 30 min read0/5 read
- The engineering craft4 parts · 21 min read0/4 read
- Frontend in depth7 parts · 129 min read0/7 read
- Business analysis for product teams6 parts · 147 min read0/6 read
- Web application security9 parts · 168 min read0/9 read