Skip to content

Commit 9410cbb

Browse files
committed
Fixes leafo#559 - mix() fix
1 parent 8b538d8 commit 9410cbb

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

src/Compiler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4526,7 +4526,7 @@ protected function libMix($args)
45264526
];
45274527

45284528
if ($firstAlpha != 1.0 || $secondAlpha != 1.0) {
4529-
$new[] = $firstAlpha * $weight + $secondAlpha * ($weight - 1);
4529+
$new[] = $firstAlpha * $weight + $secondAlpha * (1 - $weight);
45304530
}
45314531

45324532
return $this->fixColor($new);

tests/inputs/functions.scss

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,4 +165,11 @@ $str: 'global';
165165
div {
166166
margin: mapping(one two);
167167
@include test();
168-
}
168+
}
169+
170+
$a: rgba(#000, 0.5);
171+
$b: rgba(#fff, 0.75);
172+
173+
.test {
174+
color: mix($a, $b);
175+
}

tests/outputs/functions.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,6 @@ p {
4949
div {
5050
margin: 1px 1px 2px 2px;
5151
padding: 1px 1px 2px 2px; }
52+
53+
.test {
54+
color: rgba(159, 159, 159, 0.625); }

tests/outputs_numbered/functions.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,6 @@ p {
5151
div {
5252
margin: 1px 1px 2px 2px;
5353
padding: 1px 1px 2px 2px; }
54+
/* line 173, inputs/functions.scss */
55+
.test {
56+
color: rgba(159, 159, 159, 0.625); }

0 commit comments

Comments
 (0)