Return to Snippet

Revision: 66174
at March 25, 2014 01:44 by eklemen


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

Initial URL

                                

Initial Description
rgba fallback for any attribute

Initial Title
rgba fallback for any attribute

Initial Tags
css, ie

Initial Language
SASS