Sass mixin for background transparency back to IE8

前端 未结 3 1604
刺人心
刺人心 2021-01-30 18:15

I\'m new to Sass and struggling with this. I can\'t get the color to render in both hex (for IE) and rgba. Every little piece is frustrating me becau

3条回答
  •  庸人自扰
    2021-01-30 18:42

    @mixin transparent($color, $alpha) {
      $rgba: rgba($color, $alpha);
      $ie-hex-str: ie-hex-str($rgba);
      background-color: transparent;
      background-color: $rgba;
      filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#{$ie-hex-str},endColorstr=#{$ie-hex-str});
      zoom: 1;
    }
    

    NOTE: The ie-hex-str is only available in recent versions, not sure when it was introduced though

提交回复
热议问题