richthegeek / phpsass

A compiler for SASS/SCSS written in PHP, brought up to date (approx 3.2) from a fork of PHamlP: http://code.google.com/p/phamlp/
http://phpsass.com/
382 stars 83 forks source link

transparent colors always converted to "transparent" #82

Closed yukulele closed 6 years ago

yukulele commented 11 years ago

rgba() / hsla() colors with 0 as alpha component are always converted to transparent in case of gradient or transition, each component are translated (r, g, b and a)

for exemple, rgba(red,0) must be converted to rgba(255,0,0,0) but phpsass convert it to transparent

transparent is equivalent of rgba(0,0,0,0)

you can see some exemple here: http://dabblet.com/gist/5088958

Phpsass should not convert all transparent colors to transparent

Pendrokar commented 10 years ago

In case of a transparent value in a gradient, Google Chrome and Opera still inherit colours from somewhere(probably neighbors), while Firefox sets it to a default value(black).

The following code inside SassColour.php is the one that does the conversion:

if ($rgba[3] == 0) { return 'transparent'; } elseif ($rgba[3] < 1) {