Syntax - Tasty Web Development Treats
Syntax - Tasty Web Development Treats

996: 10 New CSS and HTML APIs

Wes and Scott talk about the latest CSS and browser features, including the Grid Lines API for masonry layouts, HTML in Canvas, name-only container queries, CSS random, search-text styling, and more. Show Notes 00:00 Welcome to Syntax! 00:57 Grid Lines API for masonry-style layouts Introducing CSS G

Featured Speakers

Wes Bos & Scott Tolinski - Full Stack JavaScript Web Developers Host

Topics Discussed

Episode Summary

Executive Summary: The episode surveys a wave of new and emerging CSS/HTML features, emphasizing quality-of-life improvements and experimental capabilities that unlock more expressive web UI. The hosts are especially enthusiastic about CSS masonry/grid lanes, HTML inside Canvas for accessible advanced rendering effects, named container queries, and other browser updates like random(), search-text styling, sticky axes, multicolumn fixes, border shapes, and scoped view transitions.

Main Topics: CSS Masonry / Grid Lanes: A new masonry-style layout approach using display: grid lanes, allowing items to flow like Pinterest-style grids with familiar grid properties and improved flexibility over old column hacks. HTML in Canvas API: An experimental API that lets developers place regular HTML inside a canvas and render it with JavaScript, enabling advanced visual effects while preserving DOM semantics and accessibility. Named Container Queries: Container queries can now be scoped by container name, offering a more native way to target specific layout regions and simplifying scoped CSS patterns. Browser/UI Quality-of-Life CSS Features: The hosts discuss new CSS features including random(), search-text/current pseudo-classes, sticky positioning on both axes, multicolumn wrap/height fixes, and border shape enhancements. View Transitions Improvements: Element-scoped view transitions enable more localized, reusable animation control for list items and other UI elements without requiring unique names for everything. Platform Support, Experiments, and Rollout Status: Several features are already in Safari or Chrome behind flags, with others experimental or partially supported; the hosts stress progressive enhancement and note uneven browser support.

Key Arguments: Masonry/grid lanes solve a long-standing layout problem more cleanly than CSS columns or older grid hacks. HTML in Canvas is exciting because it preserves real HTML while enabling pixel-level effects, unlike traditional canvas-only UIs. Named container queries provide native scoping and reduce the need for class-based scoping systems. Random() in CSS removes the need to generate seeded random values in the view layer for many use cases. Search-text/current styling makes browser find-in-page UI more themeable and useful. Sticky positioning working on both axes and multicolumn wrapping fixes address practical layout pain points. Border shape is more than decorative squircles; it can affect borders, focus shapes, and cutouts in useful ways. Element-scoped view transitions simplify animation of repeated elements such as cards and list items. Browser support is fragmented, so many of these features are best approached as progressive enhancements.

Data Points: Safari version for CSS masonry/grid lanes: 26.4 - Mentioned as the version where the masonry-style layout is available in Safari. Chrome status for CSS masonry/grid lanes: behind a flag - Chrome support exists but is not yet stable. Firefox status for CSS masonry/grid lanes: behind a flag - Firefox support exists but is not yet stable. Chrome version for element-scoped view transitions: 147 - The episode notes this feature is in Chrome 147. Chrome version for named container queries: 148 - One of the versions cited for named container query support. Firefox version for named container queries: 149 - One of the versions cited for named container query support. Safari version for named container queries: 26.4 - One of the versions cited for named container query support. CSS random example range: 0 to 100, step 2 - Example given: random(0, 100, 2) chooses an even number between 0 and 100. Sticky positioning axis support: 2 axes - Chrome 148 reportedly supports sticky positioning on both axes rather than only one.

Pivotal Quotes: "display grid lanes" — Scott Tolinsky / Wes Bos: Describing the new CSS masonry-style layout API and how simple it is to use. "You can simply just put elements inside of a canvas." — Wes Bos: Explaining the experimental HTML-in-Canvas API and its core concept. "There are so many neat stuff in CSS, stuff you can use, stuff you can't use, stuff you can progressively enhance in your code base today." — Wes Bos: Closing summary of the episode’s main message about adopting new browser features carefully.

Implications: Developers get more native, expressive tools for layout, animation, and visual effects, often with better accessibility than custom JS solutions. The episode suggests a near future of richer UIs through progressive enhancement as browser support matures.

🔓 Sign Up for Unlimited Episode Search

About Syntax - Tasty Web Development Treats

View all episodes from Syntax - Tasty Web Development Treats