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

799: Hot New and Under-Utilized Browser APIs

Scott and Wes serve up the latest and most under-utilized browser APIs that are changing the game for web development. From the @starting-style CSS API to scroll-snap and popovers, they break down how these tools can elevate your projects with minimal effort. Show Notes 00:00 Welcome to Syntax! Inst

Featured Speakers

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

Topics Discussed

Episode Summary

Executive Summary: The episode surveys emerging and underused browser APIs that let developers replace common JavaScript UI patterns with native platform features. The hosts focus on starting-style, allow-discrete transitions, calc-size, scroll-snap, view transitions, popover, dialog, and details, emphasizing accessibility, progressive enhancement, and reduced dependency on frameworks and libraries.

Main Topics: Starting style and allow-discrete transitions: A pair of CSS features that enable smoother enter/exit animations, including animating elements that were previously display:none, by defining pre-enter styles and discrete property transitions. Calc-size for intrinsic size animations: The hosts explain how calc-size can help transition toward intrinsic dimensions like auto, reducing the need for JavaScript measurement when animating height/width changes. Scroll Snap as a lightweight swiper/slideshow tool: Scroll snap is presented as a highly supported native way to build swipeable carousels and even slideshow controls with minimal JavaScript for indicators and navigation. View Transitions API for page and state changes: View transitions are used for SPA route changes, element show/hide animations, and even cross-page transitions, with CSS keyframes and view-transition-name enabling rich motion. Popover and Dialog for accessible overlays: Popover is positioned as a simple, accessible replacement for menus and drawers; dialog is framed as the better choice for true modals due to focus trapping and inert background behavior. Details element and fallback animation strategies: Details/summary is highlighted as a long-standing native accordion, while JS/web animations are discussed as practical workarounds for animating height and disclosure behavior today. Progressive enhancement and browser support strategy: Across all APIs, the hosts stress checking support percentages, using polyfills where possible, and accepting graceful fallback instead of shipping large libraries.

Key Arguments: Modern browser APIs can replace a surprising amount of UI JavaScript, especially for menus, modals, accordions, carousels, and route transitions. Starting-style plus allow-discrete removes the need for multi-class hacks when animating elements into view and handling display toggles. Scroll snap can deliver smooth, native-feeling swipe experiences and even slideshow controls with only a small amount of JavaScript for state and indicators. View Transitions API is one of the most powerful new platform features because it can animate SPA navigation, element swaps, and page-level transitions with minimal code. Popover is valuable because it is simple, accessible by default, and provides keyboard handling and Escape-to-close behavior without custom code. Dialog is best reserved for true modals because it enforces focus management and inert background behavior, which is critical for accessibility. Developers should prefer browser-native primitives over large dependency stacks when the browser already exposes the needed behavior. When support is incomplete, progressive enhancement is acceptable because the fallback is often just a non-animated or simpler experience rather than a broken UI.

Data Points: Starting-style support: 72% of users - Current support estimate mentioned for the CSS starting-style feature. Calc-size status: Chrome intent to ship; still in draft stage - The feature has been implemented in Canary and is expected to move forward, but is not broadly available yet. Scroll Snap support: 94% of users - The hosts describe scroll snap as nearly universal and safe to ship. View Transitions support: 72% of users - Current support estimate mentioned for the View Transitions API. Popover support: 86% of users - The popover API is described as widely available across major browsers. Details support in Chrome: Chrome 12 - Used to emphasize that the details element has been available for a long time. Details support in Safari: Safari 6 - Also used to show long-standing browser support for the details element. Tutorial length: 41 minutes - The shameless plug for the local-first tutorial on the Syntax YouTube channel.

Pivotal Quotes: "starting style is one of these really cool APIs that you might not have necessarily considered that you need" — Scott: Introducing the CSS at-rule that enables pre-enter styling and smoother transitions. "You can just continue to swipe it like you would, and it works fully mobile" — Scott: Describing the scroll snap swiper demo and how little JavaScript it requires. "The big problem with that is that top layer does not exist inside of the current document flow" — Scott: Explaining why popovers and dialogs can’t be positioned with normal relative/absolute container logic.

Implications: These APIs let teams build more accessible, performant interfaces with less code and fewer dependencies. For many common UI patterns, native browser primitives are becoming the best default, with frameworks increasingly optional rather than required.

🔓 Sign Up for Unlimited Episode Search

About Syntax - Tasty Web Development Treats

View all episodes from Syntax - Tasty Web Development Treats