All Things Frontend
amar's profile
Amar

@amar•Nov 21, 2025
13.6K
daily.dev's profile
Post cover image

The CSS if() Function Has Arrived!

From medium.com•Sep 26, 2025•4m read time

CSS now supports conditional logic with the new if() function, officially shipped in Chrome 137. 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.

23 Comments

Sort:

amar's user avatar
Amar
@amar
Joined Jun 27. 2024
13.6K
daily.dev's profile

daily.dev

Verified

If something's broken on the app, you can blame me... 🥺

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • © 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard