resource / Front-End-Standards

Front-end development standards for Resource.
MIT License
23 stars 1 forks source link

Why say Use hex or rgba? #55

Closed nicetransition closed 11 years ago

nicetransition commented 11 years ago

CSS.md#value-formatting Why say Use hex or rgba?

It might be better to say when using rgb( and rgba( to include a fallback, i.e.:

.selector-name {
    color: #ccc; // #ccc = the output color of flattened 20% black on white
    color: rgba(0,0,0,.2);
}
nicetransition commented 11 years ago

I see that fallback is in https://github.com/LukeAskew/Front-End-Standards/blob/master/Stylesheets/CSS.md#browser-compatibility, but is that the right place?

LukeAskew commented 11 years ago

What benefit does using rgb at all have? Why not just use rgba with an alpha of 1?

The reasoning for the standard is two-fold:

  1. rgba and hex are slightly more performant that named shortcuts and hsla, and hsla is not an
  2. To provide consistency and predictability.
nicetransition commented 11 years ago

RGB has better support, that's it. But not major concern.