W3C home > Mailing lists > Public > public-css-archive@w3.org > October 2016

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

From: Christoph Päper via GitHub <sysbot+gh@w3.org>
Date: Tue, 04 Oct 2016 11:38:31 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-251364549-1475581110-sysbot+gh@w3.org>
So, for “locks”,

``` css
selector {
  property: /* $min_value ≤ */ $fallback_value /* ≤ $max_value = 
$min_value + $max_increment */;
}
@media (min-width: $min_vw) and (max-width: $max_vw) {
  selector {
    property: calc( $min_value + $max_increment *   (100vw - $min_vw) 
                //*                               ———————————————————
  */
                                                  ($max_vw - $min_vw)
  );
  }
}
@media (max-width: $min_vw) {
  selector {
    property: calc( $min_value + 0 );
  }
}
@media (min-width: $max_vw) {
  selector {
    property: calc( $min_value + $max_increment /* = $max_value */ );
  }
}
```

would become

``` css
selector {
  property: /* $min_value ≤ */ $fallback_value /* ≤ $max_value = 
$min_value + $max_increment */;
  property: calc( $min_value + $max_increment * min(  (100vw - 
$min_vw) 
              //*                                   
———————————————————     */
                                                    ($max_vw - 
$min_vw), 1) );
}
```

right?

I wonder if authors would also find good use for `mid()`dle/`avg()`, 
`med()`ian, `mod()`e etc.

-- 
GitHub Notification of comment by Crissov
Please view or discuss this issue at 
https://github.com/w3c/csswg-drafts/issues/544#issuecomment-251364549 
using your GitHub account
Received on Tuesday, 4 October 2016 11:38:41 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:04 UTC