All Topics
All Topics
Technology
Technology
AI
AI
Business
Business
Entertainment
Entertainment
News
News
Programming
Programming
Security
Security
Science
Science
Design
Design
Environment
Environment
Finance
Finance
Crypto
Crypto
Politics
Politics
Sports
Sports
Education
Education
Gaming
Gaming
Art
Art
Music
Music
Health
Health
Books
Books
Food
Food
Travel
Travel
Personal
Personal
Bluesky
Twitter

The Blurring Line Between CSS State Tracking and JavaScript Event Handling

By

@dxnnydotfun

6d ago· 10 min readenInsight

Summary

This article explores the increasingly blurred line between CSS pseudo-classes (which track states) and JavaScript events (which listen for actions). It discusses how modern CSS features like pseudo-classes are accumulating capabilities that feel like event listeners, and examines proposals like event-trigger in the Animation Triggers spec. The piece reflects on how CSS is evolving to handle interactions that were traditionally the domain of JavaScript, questioning where the boundary between the two technologies now lies.

Source

CSS-TricksThe Blurring Line Between CSS State Tracking and JavaScript Event Handlingcss-tricks.com

Key quotes

· 3 pulled
CSS is listening to us. No, not like that. Rather, CSS is accumulating more and more pseudo-classes to help us respond to JavaScript events so that we don't have to do so with JavaScript itself.
But while pseudo-classes track states, not events, they sure can feel like event listeners sometimes (not that it really matters in the context of CSS).
Then again, what is CSS these days? For example, there's a proposal for event-trigger in the Animation Triggers spec, which would basically listen for events and trigger animations.
Snippet from the RSS feed
CSS has always had pseudo-classes that style things based on user interactions. Recent features, however, are blurring the line between what CSS "listens" for and how they are alternatives to what Javascript typically listens for.

You might also wanna read

Comments

Sign in to join the conversation.

No comments yet. Be the first.