All posts
Web

Chrome Shipped CSS if() Over a Year Ago and Safari Still Has Not

ZKO blog tile: Web

The State of CSS 2026 survey just placed the if() function third on developers' most wanted list, behind only anchor positioning and view transitions. That is a strange place for a feature to sit a year after it actually shipped. Chrome added if() from version 137, letting you write conditional styles directly in a property value using style(), media(), or supports() checks, no preprocessor and no JavaScript fallback required.

The gap between shipped and wanted is entirely about browser support. Safari and Firefox still have not implemented if(), which means anyone who wants to use it in production is choosing between writing two versions of a rule or waiting. For a feature this genuinely useful, that is a familiar and frustrating position, the sort of gap that used to take container queries years to close.

We have started using if() on Chromium only internal tools, prototypes, and admin panels where we control the browser, and we are staying on media queries and JavaScript everywhere client facing until support catches up. That split is annoying to maintain but it is the honest answer right now. A feature is not really shippable until the browsers your actual users open agree on it, no matter how high it ranks in a survey of the people who already wish they could use it.