Wednesday, July 18, 2018

Sass - color transparency mixin

Use the following mixin
@mixin background-opacity($color, $opacity: 0.3) {
    background: $color; /* The Fallback */
    background: rgba($color, $opacity);
}
Example of usage:
element {
     @include background-opacity(#333, 0.5);
} 

No comments:

Post a Comment