Skip to content
This repository has been archived by the owner on Dec 24, 2020. It is now read-only.

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudhead committed Dec 2, 2009
2 parents b789e74 + 88a4fa0 commit 4a7e66e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 11 deletions.
9 changes: 7 additions & 2 deletions lib/less/engine/nodes/function.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,14 @@ def evaluate context = nil
if Functions.available.include? self.to_sym
send to_sym, *@args
else
Node::Anonymous.new("#{to_sym}(#{@args.map(&:to_css) * ', '})")
args = @args.map { |e|
e.parent = self.parent
e = e.evaluate(context) if e.respond_to?(:evaluate)
e.to_css
} * ', '
Node::Anonymous.new("#{to_sym}(#{args})")
end
end
end
end
end
end
13 changes: 10 additions & 3 deletions spec/css/dash-prefix.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
body {
background: green;
.test1 {
background-image: -moz-linear-gradient(top, bottom, from(#030303), to(#010101));
background-image: -webkit-gradient(linear, left top, left bottom, from(#030303), to(#010101));
}
.test2 {
background-image: -moz-linear-gradient(top, bottom, from(#020202), to(#010101));
background-image: -webkit-gradient(linear, left top, left bottom, from(#020202), to(#010101));
}
.test3 {
background-image: -moz-linear-gradient(top, bottom, from(red), to(green));
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, red), color-stop(1, green));
background-image: -webkit-gradient(linear, left top, left bottom, from(red), to(green));
}
25 changes: 19 additions & 6 deletions spec/less/dash-prefix.less
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
@top_color: red;
@bottom_color: green;
@global_color: #010101;
@red_color: red;
@green_color: green;

body {
background: @bottom_color;
background-image: -moz-linear-gradient(top, bottom, from(@top_color), to(@bottom_color));
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0.00, @top_color), color-stop(1.00, @bottom_color));
.gradient (@local_color: #030303) {
background-image: -moz-linear-gradient(top, bottom, from(@local_color), to(@global_color));
background-image: -webkit-gradient(linear, left top, left bottom, from(@local_color), to(@global_color));
}

.test1 {
.gradient;
}

.test2 {
.gradient(#020202);
}

.test3 {
background-image: -moz-linear-gradient(top, bottom, from(@red_color), to(@green_color));
background-image: -webkit-gradient(linear, left top, left bottom, from(@red_color), to(@green_color));
}

0 comments on commit 4a7e66e

Please sign in to comment.