Skip to content

CSS3 Colors Fallback Rule #207

@dmcass

Description

@dmcass

Name: CSS3 Colors
Rule: When using CSS3 colors, a fallback color should be provided for browsers which don't support them.
Affected Browsers: IE6, IE7, IE8
Source: http://caniuse.com/#css3-colors

Failing example:

.rgba {
  color: rgba(0, 0, 0, 0.5);
}
.hsl {
  color: hsl(0, 0%, 0%);
}
.hsla {
  color: hsla(0, 0%, 0%, 0.5);
}

Passing example:

.rgba {
  /* Fallback with RGB */
  color: rgb(0, 0, 0);
  color: rgba(0, 0, 0, 0.5);
}
.hsl {
  /* Fallback with hex */
  color: #000;
  color: hsl(0, 0%, 0%);
}
.hsla {
  /* Fallback with constant */
  color: black;
  color: hsla(0, 0%, 0%, 0.5);
}

Opened issue as requested by @nzakas in #206

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions