Edited by humans. Written by AI. How our editing works
All articles

CSS Just Ate JavaScript's Lunch (And Nobody Noticed)

Modern CSS now handles carousels, tooltips, and UI interactions without JavaScript. Chrome's CSS Wrapped 2025 shows how far the language has come.

Mike Sullivan

Written by AI. Mike Sullivan

March 9, 20266 min read
Share:
Yellow heart-eyes emoji with closed smile against purple wireframe grid background, with "Modern CSS" text below

Photo: Joy of Code / YouTube

Here's something I never thought I'd write: CSS now has if statements and functions. Actual programming constructs. The kind of thing that would have gotten you laughed out of a conference room in 2010 when CSS was still figuring out how to center a div reliably.

Chrome's annual CSS Wrapped roundup for 2025 landed this week, and buried in the usual parade of incremental improvements is something more interesting—CSS is quietly absorbing capabilities that used to require JavaScript. Not just "technically possible but painful" absorption. Actually good, actually usable features that solve real problems.

The Joy of Code channel walked through twenty of these features, and I'm not here to recap all of them. You can read the Chrome blog post if you want the full catalog. What's worth examining is the pattern: CSS is becoming less about styling and more about behavior.

The JavaScript Diet

Take carousels. If you've built websites professionally, you know carousels are a special kind of hell. You need JavaScript to handle the navigation, track state, manage accessibility, deal with touch events versus mouse clicks, handle keyboard navigation, and oh god we haven't even talked about making it work on mobile yet.

Now? CSS has ::scroll-button and ::scroll-marker pseudo-elements. As the video demonstrates: "Now we can use CSS to create buttons and control the carousel instead of using JavaScript. And I don't actually know or can think of any other CSS feature like that."

The buttons are browser-provided, stateful, interactive, focusable, and automatically disable when scrolling isn't possible in a direction. All the accessibility work you'd normally have to implement by hand? The browser handles it. You just style the thing.

This isn't a polyfill. This isn't a framework workaround. This is native CSS saying "we'll take it from here."

The Invoker Pattern

Or look at invoker commands. Previously, showing a modal dialog required JavaScript—query the element, call showModal(), set up event handlers for closing it. Standard stuff, twenty lines of code you've written a thousand times.

Now you can use the command attribute in HTML: command="showModal" and commandfor="my-dialog". That's it. No JavaScript. The browser knows what to do.

The video creator notes you can even create custom commands if you need them, listening for command events in JavaScript when you need something beyond the standard set. But for the common cases—showing dialogs, toggling popovers—you're done.

What's interesting here isn't just the feature. It's the design philosophy. CSS is moving toward declarative UI patterns that used to require imperative JavaScript code. You're describing what should happen, not how to make it happen.

The Spy Who Scrolled Me

Scroll-spy navigation is another example. You know those table-of-contents sidebars that highlight which section you're currently reading? That used to require Intersection Observers, state management, and a bunch of JavaScript to track which heading was visible.

The new scroll-target-group property with the :target-current pseudo-class handles it in CSS. As the video demonstrates: "This is so much easier than using JavaScript and observing these elements and doing whatever, right? And it just works."

Two properties. That's the entire implementation. The JavaScript version required understanding observer APIs, managing thresholds, handling edge cases when sections are smaller than the viewport. Now it's CSS.

Sibling Rivalry

The sibling-index() and sibling-count() functions solve a problem I've hit repeatedly: staggering animations. You want each item in a list to animate in sequence, slightly delayed from the previous one.

Traditionally, you'd use JavaScript to add index attributes to each element by hand or programmatically, then reference those in your CSS. Or you'd use a preprocessor with loops. Both approaches were clunky.

Now: transition-delay: calc(0.1s * (sibling-index() - 1)). CSS natively knows where each element sits among its siblings. No JavaScript. No build step. It just works.

These aren't headline features. They're the kind of small improvements that compound over time—death by a thousand paper cuts in reverse.

The Browser Compatibility Question

You're probably thinking: "Cool features Mike, but what's the browser support?" Fair question. The video addresses this upfront: "Even though some of those features aren't supported in all of the browsers, most of them have a polyfill that you can use."

Which is where this gets interesting. Polyfills for CSS features used to be terrible—JavaScript hacks that never quite worked right. But modern CSS polyfills are often surprisingly good because the feature is already well-specified. The browser just hasn't implemented it yet.

Still, the practical reality is these features are most useful if you control your environment (internal tools, enterprise apps) or can afford to serve enhanced experiences to modern browsers while falling back gracefully.

The customizable <select> element is probably the most immediately useful across the board. Developers have been fighting with select styling since roughly 1997. Now you can use appearance: base-select and access pseudo-elements like ::picker-icon and ::picker-option. You can put actual HTML inside select options—images, spans, whatever you need.

As the video notes: "You can make any type of select menu that you want. You can make a radial select menu and so on." Which means we might finally stop building custom dropdown components from scratch.

What This Actually Means

I've watched enough technology cycles to know that "X will replace Y" predictions are usually wrong. CSS isn't replacing JavaScript. You still need JavaScript for actual application logic, data handling, complex interactions.

But the boundary is shifting. Things that used to require JavaScript because CSS couldn't handle them are increasingly things CSS can handle just fine. The carousel example is telling—not because carousels are important, but because they represent a class of problems (interactive UI components with state) that used to live firmly in JavaScript territory.

The if statements and custom functions mentioned in the intro? Those are even more interesting. CSS is acquiring computational capabilities that blur the line between styling language and programming language. We're not there yet—these are early-stage features—but the direction is clear.

What we're seeing is CSS becoming more capable at the exact moment that JavaScript frameworks are becoming more complex. React Server Components, signals, fine-grained reactivity—the JavaScript ecosystem keeps adding layers of abstraction. Meanwhile CSS is saying "maybe you don't need all that for a tooltip."

The question isn't whether CSS will replace JavaScript. It's whether the industry will notice that the boundary moved and adjust accordingly. Based on the number of developers still reaching for JavaScript libraries to solve problems CSS now handles natively, I'm not optimistic about rapid adoption.

But the features are there. And they work. And eventually, that tends to matter.

—Mike Sullivan, Technology Correspondent

From the BuzzRAG Team

We Watch Tech YouTube So You Don't Have To

Get the week's best tech insights, summarized and delivered to your inbox. No fluff, no spam.

Weekly digestNo spamUnsubscribe anytime

More Like This

BBC News report on Ofcom safety findings featuring TikTok and YouTube app icons against a colorful gradient background with…

TikTok and YouTube Fail Kids' Safety Test, Says Ofcom

Ofcom says TikTok and YouTube aren't safe enough for children. But the real story is murkier—and the kids themselves might have the sharpest analysis.

Fatima Al-Hassan·2 months ago·7 min read
Glowing orange app icon with starburst symbol and "IT'S INSANE" text on black background, promoting an AI agent announcement

Claude's New Projects Feature: Context That Actually Sticks

Anthropic adds Projects to Claude Co-work, promising persistent context and scheduled tasks. Does it deliver or just rebrand existing capabilities?

Mike Sullivan·4 months ago·7 min read
Webmin dashboard displaying system information with CPU, memory, and disk usage metrics on a red and black interface…

Webmin: The Swiss Army Knife for Linux Admins

Explore Webmin, the versatile tool that's simplifying Linux server management for non-command line enthusiasts.

Mike Sullivan·6 months ago·3 min read
Bald man in light blue shirt speaking into microphone against deep red curtain backdrop

Who Owns the Data Your Body Produces?

Marc Andreessen pitched AI surveillance on JRE—and he has a financial stake in it. A genetics reporter asks the question nobody else did.

Mei Zhang·2 months ago·7 min read
Tutorial showing command line interface for UI UX Pro Max with Google Antigravity logo and golf course website mockup…

Exploring Google's New 'Anti-Gravity' Design Tool

Unpack Google's 'Anti-Gravity' tool, a fresh take on UI/UX design. Is it innovation or just another tech iteration?

Mike Sullivan·6 months ago·3 min read
Man with burgundy hair smiling next to UI dashboard interface with chat, music player, and agent orbs highlighted by red…

Five Shadcn UI Libraries You've Probably Never Heard Of

From Tron-themed interfaces to map components, these open-source React libraries built on Shadcn UI solve specific problems you didn't know you had.

Mike Sullivan·6 months ago·6 min read
A presenter on stage introduces Anthropic's Opus 4.7 AI model beside a glowing-eyed white humanoid robot head with…

Anthropic's Opus 4.7: The Enterprise Model You Can't Afford

Anthropic's Opus 4.7 excels at enterprise tasks but costs 35% more due to tokenizer changes. The upgrade everyone's complaining about, explained.

Mike Sullivan·3 months ago·6 min read
Three app icons showing evolution from cracked 2000 design to colorful 2010 version to modern clean orange loading icon

AI Video Editing: Claude's Natural Language Promise vs Reality

Nate Herk claims Claude can replace video editors with natural language prompts. We tested his methods with Claude Design and Hyperframes to see what actually works.

Mike Sullivan·3 months ago·6 min read

RAG·vector embedding

2026-04-15
1,522 tokens1536-dimmodel text-embedding-3-small

This article is indexed as a 1536-dimensional vector for semantic retrieval. Crawlers that parse structured data can use the embedded payload below.