[csswg-drafts] [css-values] max() issue (#11768)

nico3333fr has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-values] max() issue ==
Hello there,

I'm Nico, one of Proton Mail/Calendar devs. I encountered an issue on some old browsers that do not support `lvh` unit in a `max` comparison, and I'd like to make sure I understood the spec correctly, and if it's the case, to propose something.

I did use something like: `block-size: max(3rem, calc((100lvh - 3.75rem - 4.75rem) / 24))` in our codebase. 

We discovered that on some old browsers that don't support `lvh` unit that the `max` comparison was totally failing. I though first `max(3rem, <something not supported>` would go to `3rem`, but it seems we `must have a [consistent type](https://drafts.csswg.org/css-values/#css-consistent-type) or else the function is invalid` https://drafts.csswg.org/css-values/#comp-func

First => could you confirm I **properly understood the spec here**? 

Second => proposal: would it make sense in these cases that when we compare `a value` and `something not supported` that **the result would default to the properly defined value**? 

For sure we can wrap stuff in an `@support (@supports (block-size: (max(1rem, 100lvh))))` to make sure we support `max` and `lvh` (what we did). But TBH, I found it a bit too much, I was thinking that comparing `max(3rem, <something not supported>` should go to `3rem`, just for graceful degradation/progressive enhancement purposes :)

Thanks,

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11768 using your GitHub account


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

Received on Monday, 24 February 2025 16:25:49 UTC