Skip to content

Commit

Permalink
Merge remote-tracking branch 'sommeri/import-refence-directives-2008'
Browse files Browse the repository at this point in the history
Conflicts:
	test/css/import-reference.css
	test/less/import-reference.less
	test/less/import/import-reference.less
  • Loading branch information
lukeapage committed Jan 26, 2015
2 parents 10586f0 + ed9b6ef commit ab96e71
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/less/tree/directive.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var Node = require("./node"),
Ruleset = require("./ruleset");

var Directive = function (name, value, rules, index, currentFileInfo, debugInfo) {
var Directive = function (name, value, rules, index, currentFileInfo, debugInfo, isReferenced) {
this.name = name;
this.value = value;
if (rules) {
Expand All @@ -11,6 +11,7 @@ var Directive = function (name, value, rules, index, currentFileInfo, debugInfo)
this.index = index;
this.currentFileInfo = currentFileInfo;
this.debugInfo = debugInfo;
this.isReferenced = isReferenced;
};

Directive.prototype = new Node();
Expand Down Expand Up @@ -56,7 +57,7 @@ Directive.prototype.eval = function (context) {
rules.root = true;
}
return new Directive(this.name, value, rules,
this.index, this.currentFileInfo, this.debugInfo);
this.index, this.currentFileInfo, this.debugInfo, this.isReferenced);
};
Directive.prototype.variable = function (name) { if (this.rules) return Ruleset.prototype.variable.call(this.rules, name); };
Directive.prototype.find = function () { if (this.rules) return Ruleset.prototype.find.apply(this.rules, arguments); };
Expand Down
11 changes: 11 additions & 0 deletions test/css/import-reference.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,14 @@ div#id.class[a=1][b=2].class:not(1) {
.test:first-child {
color: blue;
}
@keyframes some-name {
property: value;
}
@supports (animation-name: test) {
@keyframes some-name {
property: value;
}
.selector {
color: red;
}
}
3 changes: 2 additions & 1 deletion test/less/import-reference.less
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@

.class:extend(.class all) {
}
.mixin-with-nested-selectors();
.mixin-with-nested-selectors();
.mixin-with-directives(some-name);
15 changes: 15 additions & 0 deletions test/less/import/import-reference.less
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,19 @@
color: blue;
}
}
}
.mixin-with-directives(@keyframeName) {
@keyframes @keyframeName {
@rules1();
}
@supports (animation-name: test) {
@keyframes @keyframeName {
@rules2();
}
.selector {
color: red;
}
}
@rules1: {property: value;};
@rules2: {property: value;};
}

0 comments on commit ab96e71

Please sign in to comment.