April 20

CSS Color Shorthand not support in Adobe Flash

Flash doesn’t support CSS color shorthand – an obscure feature of CSS that I bet not many know about.

CSS color shorthand defines that whenever a both hex digits in a color component of a CSS color are the same, you can eliminate one digit to reduce the color definition from 6 digits (2 each for RGB) to three digits (1 for each of RGB).

For example, white is #FFFFFF. But it can also be written as #FFF. Blue is #0000FF, but can be shortened to #00F.

Every browser seems to support this, including those based on Gecko, Webkit, Opera, and KHTML, which is really cool – CSS compressors (such as YUI Compressor) take advantage of this neat trick to knock a little off the size of a css file.

However, Adobe Flash does not support CSS shorthand color defintions. I thought Flash was supposed to be CSS compliant, so this surprised me. For example, #FFF (which should be white) shows up as a blue in Flash. Interestingly, Adobe knows about CSS color shorthand, as they discuss it in this Dreamweaver article.

I’ve filed bug with Adobe (no public bugtracker?), Gnash, and swfdec.

Comments

  1. Benjamin Otte said on April 22nd, 2008

    Adobe’s bugtracker is at http://bugs.adobe.com/ – but they seem to consider this a secret. ;)

    As for the feature in Swfdec, I’m gonna close that one as NOTABUG, since we try to be bug-for-bug compatible with Adobe’s Flash Player. And if Adobe says #FFF is blue, then it is blue. If you want standards compliance, don’t use Flash…

Add a comment
Technorati Profile

Browse posts by month

Browse by author

We're always looking for rockstars

Come take a look at careers with Molecular