background-opacity.scss 792 B

12345678910111213141516171819202122232425
  1. // produces a partly opaque background using RGB alpha channel
  2. // with a workaround for IE8 that doesn't support it
  3. @mixin background-opacity(
  4. $background-color: null,
  5. $opacity: 1,
  6. $include-ie: $include-ie
  7. ) {
  8. @if $background-color == transparent {
  9. background-color: $background-color;
  10. } @else {
  11. $background-opaque: rgba($background-color, $opacity);
  12. background-image: none;
  13. background-color: $background-opaque;
  14. @if $include-ie {
  15. $ie-background-str: ie-hex-str($background-opaque);
  16. .#{$prefix}ie8 & {
  17. -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#{$ie-background-str}, endColorstr=#{$ie-background-str})";
  18. zoom: 1;
  19. }
  20. }
  21. }
  22. }