Re: [css] Proposal: making Shorthand Hex Colors even shorter (16 grayscale shades)

2011/9/5 Marat Tanalin <>:
> My message _is_ reply to latest thread by Markus Bruch (consider subject). I've just recently joined to www-style, so cannot to reply directly to thread-starting message by Markus.

Ah, okay.  Sorry about that, then.

> On Mon, Sep 5, 2011 at 2:23 PM, Marat Tanalin <> wrote:
>>  Recently, when I (once again) was typing redundant #ccc, #666, #999, etc., I've arrived at the same idea: it would be nice to be able to use #c, #6, #9 shortcuts.
>>  Replacing #acacac with #ac looks quite nice and reasonable too. There is nothing wrong with #ac compared with #c as well as with existing #ccc.
>>  Such shortcuts are not more consusing than existing #ccc, #666, #999, etc.
>>  As for similar additions to rgba (that has been mentioned in the thread), I personally almost don't care about this since I consider rgba paradigm itself just wrong and almost useless as for CSS:
>>  instead of rgba(), it would be _much_ more useful to have background-opacity property that would control opacity of _entire_ background including background color _and_ image together. Those interested may see proposal in sibling thread I've started a moment ago:

I don't understand how you think rgba() is wrong and how it can be
replaced by 'background-opacity'.  Colors are used in far more than
just 'background-color'.  Partially-transparent border or text colors
are useful, and specifying them with an alpha color is simple (better
than adding 'border-color-opacity' and 'color-opacity' properties, for
certain).  Alpha colors are also very useful as color-stops in
gradients, where there is absolutely no way to replace them with a

After more thought on the matter of 1- or 2-digit hex shorthands,
though, I've now come down against it.  I gave my reasoning against
2-digit grays previously in the thread (the expansion rule is
different than for 3-digit color).

As for 1-digit grays, I no longer think they're a good idea.  When
Colors 4 gets written I'll be pushing for (or writing, if I end up the
editor) 4- and 8-digit hex colors so you can specify alpha without
having to switch to rgba() and convert your components to decimal.  I
don't think it's good to add a new hex variant that can't similarly
receive an alpha.  (Obviously, having #0 expand into #00000000 isn't
useful.  Adding a second digit, like having #0c expand into #000000cc,
is just confusing.)

The benefit of 1-digit grays is extremely minimal.  You get to hit a
key once instead of three times.  It's the same key all three times,
too, so the burden of hitting it thrice is basically nil.

I am still okay with a gray() function, though, which takes a single
number/percentage, and then optionally an alpha value.  I'm not sure
if we *need* it, but I'm favorably disposed to it.


Received on Monday, 5 September 2011 23:03:59 UTC