任何属性的rgba回退

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了任何属性的rgba回退相关的知识,希望对你有一定的参考价值。

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. }

以上是关于任何属性的rgba回退的主要内容,如果未能解决你的问题,请参考以下文章