Re: [csswg-drafts] Should common @when and if() functions be the same? (#12903)

Unifying these somehow would be nice! It'd simplify implementation, but also I think it's less confusing to authors if the same condition is valid wherever they put it.

> For a more concrete question, `@when media(width > 10em)` treats `em` as the initial value since it has no context.
> Should `if(media(width > 10em): /* ... */)` do the same for consistency, or should it use the context to resolve `em`?

My instinct would be no, it should be whatever `em` is in that context. That seems more useful I think? But it'd be worth seeing what's more intuitive to authors.

-- 
GitHub Notification of comment by AtkinsSJ
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12903#issuecomment-3376080738 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 7 October 2025 09:57:21 UTC