在 sass 中将不透明度设置为 $basic-color

是否有一个选项,包括不透明的颜色,你定义为你的主色/次色在 sass 变量?按照淡化($color,amount)函数的方式?

61288 次浏览

You can use rgba, i.e.

$primary: rgba(20,20,20, .5);

It works for hex values as well

$primary: rgba(#4B00B5, .3);

You can also set the opacity of colors based on a variable value. For example:

$primary-color: #a61723;
....
color: rgba($primary-color, .5);

Demo