Jump to content


Consider adding CSS Color Name lookup to CSS plugin?

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Recently I found a background color animation was failing in IE8, this was because I was reading the color to tween to from a hidden div and IE8 was returning the value as 'whitesmoke'. It's easy enough to use a lookup table as here:




But might be nice if this was handled internally by the CSS plugin.

Link to comment
Share on other sites

We actually do have a color lookup in CSSPlugin, but it only covers the most common/standard ones in order to conserve file size. Apparently not all browsers support the exhaustive list, so we focused on the common ones that all browsers understand:

  • aqua
  • lime
  • silver
  • black
  • maroon
  • teal
  • blue
  • navy
  • white
  • fuchsia
  • olive
  • yellow
  • orange
  • gray
  • purple
  • green
  • red
  • pink
  • cyan
  • transparent
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.