Skip to content

Commit 0b8aa30

Browse files
committed
don't write colors with alpha as 1 with rgba
1 parent 39603ee commit 0b8aa30

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lessc.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1369,7 +1369,7 @@ function compileValue($value) {
13691369
// [2] - green component
13701370
// [3] - blue component
13711371
// [4] - optional alpha component
1372-
if (count($value) == 5) { // rgba
1372+
if (count($value) == 5 && $value[4] != 1) { // rgba
13731373
return 'rgba('.$value[1].','.$value[2].','.$value[3].','.$value[4].')';
13741374
}
13751375
return sprintf("#%02x%02x%02x", round($value[1]), round($value[2]), round($value[3]));

tests/outputs/colors.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ body {
1919
spin:#efefef;
2020
spin:#1769e7;
2121
spin:rgba(23,118.86666666667,231,0.5);
22-
one:rgba(171,205,239,1);
23-
one:rgba(171,205,239,1);
22+
one:#abcdef;
23+
one:#abcdef;
2424
two:rgba(2,159,35,0.9);
2525
two:rgba(2,159,35,0.9);
2626
three:rgba(1,2,3,0.6);

0 commit comments

Comments
 (0)