Loading ...
Sorry, an error occurred while loading the content.

1061`rgba` is unrecognized

Expand Messages
  • Mike West
    Jan 19, 2010
    • 0 Attachment
      JSLint doesn't appear to recognize the (relatively new) `rgba` syntax
      for defining colors with alpha channels. Specifically:

      @charset "UTF-8";

      div {
      background: rgb( 0, 0, 0 );
      background: rgba( 0, 0, 0, 0.5 );
      }

      gives the following errors:

      Error:
      Problem at line 5 character 21: Unexpected token 'rgba'.

      background: rgba( 0, 0, 0, 0.5 );

      Problem at line 5 character 25: Expected ';' and instead saw '('.

      background: rgba( 0, 0, 0, 0.5 );

      Problem at line 5 character 27: Excepted a style attribute, and
      instead saw '0'.

      background: rgba( 0, 0, 0, 0.5 );

      Problem at line 5 character 28: Expected ':' and instead saw ','.

      background: rgba( 0, 0, 0, 0.5 );

      Problem at line 301 character 30: Result of expression 'v'
      [undefined] is not an object.

      Adjusting the `cssColor` function to look for `rgb` and `rgba`, and
      setting the number of expected tokens accordingly, looks like it
      addresses the issue. I've done this here as an example:
      http://gist.github.com/281085

      Thanks!

      -Mike
    • Show all 3 messages in this topic