For years, JavaScript was the default answer for anything interactive on the web. But the platform has caught up, and many patterns once requiring scripts now work natively in CSS.
Container Queries
Media queries respond to the viewport. Container queries respond to the element’s own container.
The :has() Selector
Previously impossible in CSS alone, :has() lets you style a parent based on its children.
- Complex state management and user interactions.
- Real-time data and WebSocket connections.
- Cross-browser polyfills where native support is insufficient.
The best front-end developers today know the platform deeply before reaching for abstractions.