Re: [csswg-drafts] [css-values] Re-adding min() and max()?

out-of-order clamping (that is, interpret the smaller one as min and larger one as max, regardless of how they were specified) can definitely be done, but it doesn't match current CSS behavior of min/max pairs.  Like "max wins", it can be done manually (where you see the minvalue in the normal expression, instead use `min(minvalue, maxvalue)`, and same with maxvalue and `max()`), and might be worthwhile to expose with flags.

(Alternately, just waiting for custom functions could let us handle this.  Since this can be done as a simple rewrite of the expressions, it might look something like:

```
@custom-function 
  --clamp-close($val, $min-val, $max-val)
  clamp($val, min($min-val, $max-val), max($min-val, $max-val);
```
)

Angle clamping can potentially be given special behavior, but can you elaborate on what your preferred behavior is? I can't understand it from your brief description.

Color clamping is a whole other kettle of fish, with *lots* of different behaviors one might want to use.

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

Received on Monday, 14 August 2017 17:51:07 UTC