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

Re: [csswg-drafts] [css-color] Unnecessary comma in color()

From: Tab Atkins Jr. via GitHub <sysbot+gh@w3.org>
Date: Mon, 11 Jul 2016 23:56:49 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-231900328-1468281407-sysbot+gh@w3.org>
I... I don't understand what you people have against percentages.  
It's "industry practice" to use 0-1 floats *because those languages 
(mostly C++) don't have any standard way to do typed-numbers and so 
just expose them as floats*.  CSS *does* have easy ways to do typed 
numbers, which are trivial to use and aid in readability. 

Like, Lea says in her comment that `color(foo .1 .2 .3 .5)` is hard to
 read, because it's unclear whether the fourth number is a fourth arg 
to the colorspace or the alpha (I agree).  But if you just write 
`color(foo .1 .2 .3 50%)`, that problem completely disappears - it's 
now 100% obvious that the last one is an alpha, even at a casual 
glance.  I argue that this is *easier* to read than `color(foo .1 .2 
.3, .5)`, and they're exactly the same number of characters, so the 
"save bytes" argument doesn't apply.

> When things in CSS are space-separated, people expect to be able to 
use any order, unless there is an obvious ambiguity (e.g. all 
numbers). I think when there is a specified order, it's more clear to 
have a comma.

I don't think it's unusual to have "names" come before "arguments".  
Everything else about this function is precisely ordered already, and 
I somewhat agree with dino's argument that we shouldn't make it 
difficult to remember where the commas need to be.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at 
https://github.com/w3c/csswg-drafts/issues/266#issuecomment-231900328 
using your GitHub account
Received on Monday, 11 July 2016 23:56:55 UTC

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