Reputation: 658
I have a SCSS file, here is one part of it. SCSS:
$red: 200;
$green: 200;
$blue: 200;
$opa: 1;
.th-layout-class{
background-color: rgba($red, $green, $blue, $opa);
padding: 10px;
border-right: 1px solid grey;
border-bottom: 1px solid grey;
border-collapse: collapse;
}
CSS:
.th-layout-class, th:nth-child(3) {
background-color: #c8c8c8;
padding: 10px;
border-right: 1px solid grey;
border-bottom: 1px solid grey;
border-collapse: collapse; }
Apparently, #c8c8c8 is rgba(200,200,200). But how to have #c8c8c8 in the rgba() format, so that opacity will be applied?
Thank you.
Upvotes: 0
Views: 308
Reputation: 33409
Because the opacity is 1, it's equivalent to the hex format without any opacity.
As it says here:
In compressed output mode, Sass will output the smallest CSS representation of a color. For example,
#FF0000
will output asred
in compressed mode, butblanchedalmond
will output as#FFEBCD
.
If you use a different opacity, it will be forced to use the rgba()
format.
Upvotes: 5