Posted By

eklemen on 03/25/14


Tagged

css ie alpha rgba fallback SASS


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Kish254838


rgba fallback for any attribute


 / Published in: SASS
 

rgba fallback for any attribute

  1. // Source: http://thesassway.com/intermediate/mixins-for-semi-transparent-colors
  2. // example use:
  3. // @include alpha-attribute(color, rgba($lt-blue1, .9), #fff);
  4. @mixin alpha-attribute($attribute, $color, $background) {
  5. $percent: alpha($color) * 100%;
  6. $opaque: opacify($color, 1);
  7. $solid-color: mix($opaque, $background, $percent);
  8. #{$attribute}: $solid-color;
  9. #{$attribute}: $color;
  10. }

Report this snippet  

You need to login to post a comment.