RE: ideas for future css versions ...

Daniël Pelsmaeker wrote:

>  > Just out of curiosity, why is there not hex notation for this, as
>>  Brian suggests?  Most designers use hex notation for their colors
>>  (it's the shortest declaration available).  Is it just too difficult
>>  to parse in hex form?  Can some sort of delimiter not be required?
>  > (E.g. color: #fff-0.8; or color: #ffffff-0.8;)  That would eliminate
>>  ambiguity issues, and a compliant 2.1 UA would just ignore the
>>  declaration, same as it would any rgba() notation.
>
>I can imagine that it wouldn't be compatible with current CSS parsers
>when they expect only six hexadecimal digits after a '#'. E.g. a parser
>might only look for a '#' followed by up to 6 hexadecimal digits, and then
>look for the next ';' ending the rule, thus ignoring the alpha component.

It might, but does it?  If so, it is not 
compliant with the spec.  Parsing is supposed to 
continue right up to the semi-colon, and only 
then should validity be checked.  Parsing should 
not proceed until a valid value is found and then 
ignore what follows until a semi-colon is 
reached.  That isn't forward-compatible, and my 
feeling was that most browser-vendors understand 
that.

Indeed, a quick check on Mac shows that Safari 
and Gecko properly ignore a rule of this form. 
Of course, IE for Mac incorrectly applies the 
rule, so maybe Microsoft is playing fast and 
loose with the spec.  I don't have a Windows box 
handy to check IE6.  Anyone?

Even if IE6 got it wrong, it is debatable whether 
or not that should be sufficient to drive the 
spec, in light of two correct and independent 
implementations.

Please consider this my request to have a hex-alpha notation in CSS3.

-Adam

Received on Tuesday, 7 September 2004 15:05:47 UTC