Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Opacify function returning unmodified hex

Tags:

css

sass

I seem to have run into something strange with sass. I'm trying to get a 95% opaque version of #111111 but it seems that the opacify function isn't returning the correct value. When I use the code below, the compiled stylesheet sets the background-color to #111111. I'm using opacify because the color is being stored as a variable in hex and cannot be modified through standard rgba if I want to continue using the variables. Code below:

$midnight: #111111;

.some-container {
  background-color: opacify($midnight,0.95);
}
like image 916
Jnatalzia Avatar asked Jul 14 '14 19:07

Jnatalzia


1 Answers

opacify increases opacity. You want transparentize():

background-color: transparentize($midnight, 0.05);
like image 100
Paul Roub Avatar answered Oct 25 '22 02:10

Paul Roub