문제

I have been using SASS for a month, love it.

However, when I create a variable such as:

$darkgrey:rgb(82,81,83);

Then decide re-use the variables, say in a specific p tag? In the body:

body{
    p.ahh-whatever{
        color:$darkgrey;
    }
}

However it always seems to come up as a HEX in all browsers. Is there a reason for this? Do I need to use RGBA with 1 Opacity...

Software Being Used:

I also use Foundation 3 inline with Compass-Style. In addition to CodeKit to compile my code, and Sublime Text 2 for my editor. Operating System is OSX 10.8 (New IMac 27").

Any help would be great!

도움이 되었습니까?

해결책

SASS will output hex whenever possible, because almost all browsers will understand it. (Not all browsers will "get" RGB values or RGBA values.)

if you do specify a an rgba value, SASS will output it as such

for instance :

rgba(blue, 0.2)    

will output :

rgba(0, 0, 255, 0.2)

see : Sass RGBA instances documentation

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top