CSS Color Shorthand not supported 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 definitions. 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 bugs with Adobe (no public bugtracker?), Gnash, and swfdec.

CC BY-SA 4.0 CSS Color Shorthand not supported in Adobe Flash by Craig Andrews is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.