mirror of
https://github.com/less/less.js.git
synced 2026-04-09 03:00:20 -04:00
If weight is not passed to mix() assume it's 50
This commit is contained in:
committed by
Luke Page
parent
70870dd9dd
commit
372569f726
@@ -106,6 +106,9 @@ tree.functions = {
|
||||
// http://sass-lang.com
|
||||
//
|
||||
mix: function (color1, color2, weight) {
|
||||
if (!weight) {
|
||||
weight = new(tree.Dimension)(50);
|
||||
}
|
||||
var p = weight.value / 100.0;
|
||||
var w = p * 2 - 1;
|
||||
var a = color1.toHSL().a - color2.toHSL().a;
|
||||
|
||||
@@ -26,6 +26,10 @@
|
||||
roundedpx: 3px;
|
||||
percentage: 20%;
|
||||
color: #ff0011;
|
||||
mix: #ff3300;
|
||||
mix-0: #ffff00;
|
||||
mix-100: #ff0000;
|
||||
mix-weightless: #ff8000;
|
||||
}
|
||||
#built-in .is-a {
|
||||
color: true;
|
||||
|
||||
@@ -31,6 +31,11 @@
|
||||
percentage: percentage(10px / 50);
|
||||
color: color("#ff0011");
|
||||
|
||||
mix: mix(#ff0000, #ffff00, 80);
|
||||
mix-0: mix(#ff0000, #ffff00, 0);
|
||||
mix-100: mix(#ff0000, #ffff00, 100);
|
||||
mix-weightless: mix(#ff0000, #ffff00);
|
||||
|
||||
.is-a {
|
||||
color: iscolor(#ddd);
|
||||
color1: iscolor(red);
|
||||
|
||||
Reference in New Issue
Block a user