Search for a command to run...

Timestamps are as accurate as they can be but may be slightly off. We encourage you to listen to the full context.
In this episode of the Stack Overflow podcast, host Ryan Donovan interviews Chris Coyier, founder of CSS Tricks and co-founder of CodePen, diving deep into the modern state of CSS. The conversation explores how CSS has evolved from basic table-based layouts to a sophisticated styling language with advanced features like variables, conditional statements, and scroll-driven animations. (05:20) They discuss cutting-edge CSS capabilities including anchor positioning for tooltips, scroll-driven animations that eliminate the need for JavaScript, and new functions like sibling-index that provide DOM-aware styling.
Chris Coyier is the founder of CSS Tricks, a comprehensive website about building websites that he ran for 15 years before selling to DigitalOcean in 2022. He is also the co-founder of CodePen, an online community platform for frontend developers where they can build, deploy, and showcase their code. Chris also hosts the ShopTalk podcast and maintains an active personal blog where he shares insights about web development and CSS innovations.
Ryan Donovan is the host of the Stack Overflow podcast and editor of the Stack Overflow blog. He brings curiosity about technology and software development to his conversations with industry experts and thought leaders.
Modern CSS now includes variables, conditional statements, and even an "if" function that can make decisions based on media queries and style conditions. (05:39) This represents a massive shift from CSS being purely declarative to having programmatic capabilities. The language now supports custom properties that can be typed and used in calculations, similar to TypeScript's approach to type safety. This evolution allows developers to create more dynamic and responsive designs without relying heavily on JavaScript, leading to better performance and cleaner code architecture.
CSS now supports scroll-driven animations that can trigger based on scroll position rather than time, eliminating the need for JavaScript event listeners. (15:09) Developers can create animations that respond to page scroll, element scroll, or even an element's position within the viewport. This feature not only simplifies code but also provides better performance since it leverages hardware acceleration at the browser level rather than relying on JavaScript event handling that fires continuously during scrolling.
The new anchor positioning feature in CSS allows elements to be positioned relative to other elements regardless of their DOM hierarchy. (11:07) This is particularly powerful for tooltips, dropdowns, and other UI elements that need to appear near specific triggers. The API includes intelligent fallback positioning that automatically adjusts placement when elements would be cut off by viewport edges, solving common UX problems with minimal code.
CSS now includes media queries for user preferences like "prefers-reduced-motion" and input method detection like "coarse" vs "fine" pointers. (20:48) These features allow developers to create more inclusive experiences by automatically adjusting animations for users sensitive to motion and optimizing button sizes for touch vs mouse interaction. However, the responsibility still lies with developers to implement these accommodations, as browsers don't automatically apply them.
Modern CSS features combine to enable fully functional carousels with dots, arrows, and swipe gestures using only CSS - no JavaScript required. (19:44) This is achieved through a combination of scroll snapping, scroll-driven animations, and other CSS features working together. This approach results in better performance, fewer dependencies, and more accessible components since the functionality is handled at the browser level rather than through custom JavaScript implementations.