W3C home > Mailing lists > Public > public-css-archive@w3.org > March 2019

Re: [csswg-drafts] [css-values] Allow sqrt(<length-percentage>) (#3764)

From: Oriol Brufau via GitHub <sysbot+gh@w3.org>
Date: Tue, 26 Mar 2019 13:52:19 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-476649544-1553608338-sysbot+gh@w3.org>
The same reasoning for avoiding dimensions in `pow` apply to `sqrt`.

If `1em` is `16px`, then `sqrt(1em)` would give `1em`, while `sqrt(16px)` would give `4px`, or `0.25em`, which are very different values for what should otherwise be identical input arguments! This sort of input dependency is troublesome for CSS, which generally allows values to be canonicalized freely; it also makes more complex expressions like `sqrt(2em + 10px)` difficult to interpret.

I don't really see how your other proposals are related to this issue, but `root(<number>, <integer>)` could be interesting because I guess `pow(-8, 1/3)` will be NaN like in JS, but `root(-8, 3)` could be `-2`.

-- 
GitHub Notification of comment by Loirooriol
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3764#issuecomment-476649544 using your GitHub account
Received on Tuesday, 26 March 2019 13:52:20 UTC

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