terminal
Weekly Digest // STYLING — Week 18-2026
paletteWeekly Report

CSS and Styling — 2026 Week 18

CSS architecture, utility frameworks, and animation performance

calendar_todaysummarizeWeek 18-2026
ANIMATION

Scroll-Driven Animations

Josh W. Comeau offers a thorough hands-on guide to the CSS Animation Timeline API, which maps @keyframes progress to scroll position rather than time. Using animation-timeline: view() ties an element's keyframe to its journey through the viewport, while animation-timeline: scroll() tracks overall page scroll. The animation-range property — with values like cover, contain, entry, and exit — lets you control exactly when an animation begins and ends. Range percentages via animation-range-start and animation-range-end give fine-grained control. Linked timelines with view-timeline and timeline-scope let one element's scroll position drive another element's animation, with a key gotcha: named timelines are scoped to the creating element and its descendants.

Scroll-Driven Animations
Read Articlearrow_forward
Video · LAYOUT

Handy CSS Layout Patterns, and Fun Ways to Elevate Them

Kevin Powell walks through three practical CSS layout patterns and two bonus visual tricks. First, an overflow horizontal scroller is built with grid-auto-flow: column and grid-auto-columns, then enhanced with scroll-snap-type: x mandatory and scroll-snap-align: center for satisfying card snapping. Second, the auto-grid pattern using repeat(auto-fit, minmax(min(100%, 300px), 1fr)) is explained in depth, including the common overflow gotcha it solves. Third, container queries are demonstrated for a sidebar component — declaring container-type: inline-size and using @container to switch to a 3-column grid at 500px. The bonus tips cover the new corner-shape: scoop property for ticket-style card corners, and a scroll-driven animation using animation-timeline: view() to scale and fade cards as they enter and exit the horizontal scroll viewport.

AI_INFOGRAPHIC
Handy CSS Layout Patterns, and Fun Ways to Elevate Them — infographicWATCH_VIDEOarrow_forward
Article · CSS HACKSREAD TIME: 7m

100% CSS: repeat(--n, anything)

Inspired by community requests to make CSS's grid repeat() generic, the author implemented a custom --repeat() CSS function using only modern CSS — no JavaScript required. The technique converts a decimal count to binary using calc() and round(down) across 8 bits, then constructs powers-of-two sets of the target value using custom properties, supporting up to 255 repetitions. The final output is assembled using the new if(style(--bitN = 1): ...; else: ;) conditional syntax, which short-circuits and avoids computing unused power variables. Use cases demonstrated include repeating values in content, text-shadow, filter drop-shadow(), and shape() line segments. The function is also available as an npm package via unpkg.

READ_FULL_LOGarrow_forward
Article · STREAMING UIREAD TIME: 17m

Designing Stable Interfaces For Streaming Content

Joas Pambou identifies three core problems in streaming UIs — scroll hijacking, layout shift, and excessive render frequency — and provides concrete JavaScript and CSS fixes for each. For scroll control, a userScrolled flag with a 60px threshold distinguishes intentional user scrolls from small layout-triggered gaps, pausing auto-scroll only when the user deliberately moves up. Layout stability is improved by writing into live text nodes character-by-character rather than wiping and rebuilding innerHTML on every token, eliminating both layout recalculation and cursor flicker. Render frequency is reduced by buffering incoming characters and flushing once per requestAnimationFrame. The article also covers clean stream cancellation, retry UX, aria-live regions, :focus-visible keyboard navigation, and prefers-reduced-motion support for typewriter animations.

READ_FULL_LOGarrow_forward
Article · COLORREAD TIME: 6m

Generative Colors with CSS

This article demonstrates how to generate a full 11-shade color palette from a single hex value using the oklch() CSS function and relative color syntax. The relative color from keyword converts any hex into its lightness (l), chroma (c), and hue (h) components, which can then be adjusted with calc(). To avoid oversaturation at extreme lightness values, chroma is scaled proportionally at each step using a formula like calc(0.08 * (c / .2)). An optional --chroma CSS variable allows manual overrides to make a palette more vivid or more muted without changing the source hex. The author uses this approach to maintain their entire site's color system from just six hex codes.

READ_FULL_LOGarrow_forward
Article · CSS UNITSREAD TIME: 4m

Modern CSS Units You Should Know: dvh, Container Query Units, lh, cap

This practical guide covers four categories of CSS length units that shipped to all major browsers in the last few years, each solving a problem that px, rem, and % cannot. The dynamic viewport unit dvh fixes the longstanding mobile Safari bug where 100vh ignores the address bar; 100dvh is now the recommended safe default for full-screen layouts. Container query units like cqw and cqi size elements relative to the nearest containment context set with container-type, enabling component-level responsive typography without media queries. The lh unit resolves to the element's computed line height, making vertical rhythm like margin-block-start: 2lh trivially maintainable. Finally, cap (cap height), ic (CJK ideograph width), and ex (x-height) let you align UI elements precisely to typeface metrics.

READ_FULL_LOGarrow_forward
Article · 3D EFFECTSREAD TIME: 6m

How to Fake a 3D Stage with HTML, CSS, and a Little JavaScript

Nick Hazekamp walks through building a convincing 3D stage illusion using CSS perspective and a minimal JavaScript tilt controller. The scene container uses perspective: 1000px, perspective-origin: 50% 36%, and transform-style: preserve-3d to establish a shared 3D space. The stage itself is a rectangle tilted with rotateX(72deg) — the CSS doing all the visual heavy lifting. A fixed background and a foreground layer translated with translate3d() complete the three-layer composition. The tricky part is keeping background and foreground widths geometrically aligned to the stage's back and front edges as the tilt changes; a small JS function reads getBoundingClientRect() and the current perspective value to compute the correct projected widths via perspective-scale math, then writes them back as CSS custom properties.

READ_FULL_LOGarrow_forward
summarizeDigest_Summary

CSS capabilities took center stage this week with several deep-dive tutorials on APIs that are now fully cross-browser. Josh W. Comeau published a comprehensive guide to the CSS Animation Timeline API, covering animation-timeline: view(), animation-timeline: scroll(), animation-range values (cover, contain, entry, exit), and linked timelines via view-timeline and timeline-scope. Kevin Powell extended the scroll theme with a layout patterns video that demonstrated scroll-snap-type: x mandatory for card snapping and the new corner-shape: scoop property for ticket-style card corners, alongside container queries with container-type: inline-size and @container.

At the experimental edge, a developer implemented a pure-CSS custom --repeat() function that converts decimal counts to 8-bit binary via calc() and round(down), then assembles repetitions using the new if(style(--bitN = 1): ...; else: ;) conditional syntax — supporting up to 255 repetitions in content, text-shadow, and drop-shadow without any JavaScript. The modern CSS units guide emphasized dvh for mobile-safe full-screen layouts, cqw/cqi for component-level responsive typography, lh for vertical rhythm, and cap/ic/ex for typeface-metric alignment.

Two more articles rounded out the week: a generative palette technique using oklch() and relative color syntax to derive 11-shade palettes from a single hex value, and a CSS 3D stage illusion using perspective: 1000px, rotateX(72deg), and perspective-scale math via getBoundingClientRect().

Key Takeaways
  • The CSS Animation Timeline API — animation-timeline: view(), scroll(), and animation-range — is now the recommended standard for scroll-driven animations; the Josh W. Comeau guide is the definitive reference.
  • A pure-CSS --repeat() function using calc(), round(down), and the new if(style()) conditional achieves up to 255 repetitions in properties like text-shadow and drop-shadow with zero JavaScript.
  • dvh replaces 100vh for mobile-safe full-screen layouts, cqw/cqi enable component-scoped responsive typography, and oklch() with relative color syntax lets you generate a full 11-shade palette from a single hex value.