Re: [csswg-drafts] [css-values] Iverson bracket functions (#4731)

Note that `inherit` is resolved very early in the cascade, when calculating specified values. But the condition may depend on layout information that we don't have at that time. Maybe an `inherit`-like feature that resolves later could be added, but it doesn't exist right now.

And yes, keywords seem more problematic, e.g. `display: if(1% > 1px, none, block)`. Here it's not just a cyclic percentage during sizing, it directly affects the box tree. It's not as easy as saying that the percentage is treated in some way during intrinsic sizing, and then it's honored or not during actual layout. Because the existence or non-existence of boxes can have wider implications.

Possibly we could add some constraints, like restricting the properties that accept `if()` (would be invalid in `display` anyways if keywords are not accepted). There have been some ideas in this direction for container queries. But going this way makes `if()` more fundamentally different than math functions, and thus less likely to become a reality soon.

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

Received on Tuesday, 4 February 2020 22:14:14 UTC