"Stop using JavaScript for that: moving features from JS to CSS and HTML"
summary
Claims that many UI patterns no longer need JavaScript and demonstrates concrete replacements and browser support. Examples: toggles built from a checkbox using appearance: none and :checked, keyboard focus via :focus-visible, smooth fragment jumps with scroll-behavior: smooth plus scroll-margin, accordions via details/summary, and modal behavior with the HTML dialog and showModal API (small JS to open). Field-sizing, customizable selects and scroll-driven animations already exist in Chromium or Safari tech previews; accessibility and browser-managed animations work reliably.
AI-written summary · about
chapters (14)
- 0:00Introduction
- 1:27HTML/CSS over JavaScript
- 4:43Custom switches in HTML/CSS
- 12:31Native switch styling
- 13:15Smooth scrolling with CSS
- 16:04Scroll margin/padding for headers
- 17:30Target highlighting with CSS
- 18:13Accordions with HTML details
- 21:47Dialog element for modals
- 25:15Animating dialogs with @starting-style
- 26:40Upcoming CSS field sizing
- 27:47Customizable select elements
- 30:27Scroll-driven CSS animations
- 31:12Q&A
related talks
30mStop using JS for that: Moving features to CSS and HTML
34mDon't Use JS for That: Moving Features to CSS and HTML
36mStop using JS for that: moving features from JS to CSS & HTML
38mI Can’t Believe It’s Not JavaScript
40mStop using JavaScript for that - Moving features from JS to CSS and HTML
31mI Can't Believe It's Not JavaScript!
39mYou Don’t Need JavaScript for That
40mJavaScript in the age of HTML 5 and CSS 3
