Dev News

Signals from the builders shaping tomorrow.

User avatar

Alex Rivera

Pro member

The CSS if() Function Has Arrived!

CSS now supports conditional logic with the new if() function, officially shipped in Chrome 137.

Author undefinedBogdan Fuerea
•Published on Dec 8, 2025
Circuit board thumbnail
This feature enables developers to set CSS properties based on conditions without JavaScript or preprocessors. The function supports three main capabilities: style queries for reacting to CSS custom properties, inline media queries for responsive design, and feature detection with supports(). Real-world applications include simplified dark mode implementation, design system components, and responsive containers. Browser support is currently limited to Chrome/Edge 137+ with Firefox in development and Safari on the roadmap.