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

[csswg-drafts] [css-values] Allow division by <length> in calc()

From: Lea Verou via GitHub <sysbot+gh@w3.org>
Date: Wed, 28 Sep 2016 16:18:15 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-179819292-1475079492-sysbot+gh@w3.org>
LeaVerou has just created a new issue for 
https://github.com/w3c/csswg-drafts:

== [css-values] Allow division by <length> in calc() ==
The reason that division by a `<length>` was originally not allowed 
was that in some cases there was no way of knowing whether that was a 
division by 0, and before Variables there was no such concept as 
_invalid in computed value time_. Now that there is, perhaps we can 
revisit this issue for [Values 
4](https://drafts.csswg.org/css-values).

This is especially useful in conjunction with CSS Variables, as 
currently one can convert from a `<number>` to a `<length>` but there 
is **no way to convert a `<length>` to a `<number>`**!. Also, 
calculating the ratio of two lengths is often very useful, e.g. what 
percentage of the viewport width is `500px`? `calc(500px / 100vw)`!

Please view or discuss this issue at 
https://github.com/w3c/csswg-drafts/issues/545 using your GitHub 
account
Received on Wednesday, 28 September 2016 16:18:26 UTC

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