Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #859 from tonistiigi/819-extends-generate-multiple…

…-selectors

Fixes #819 Extends generate duplicate selectors
commit fdb322b614d77eae16329e01418bd54394e3ced1 2 parents e2336af + 5d6eba4
@tj tj authored
View
6 lib/visitor/normalizer.js
@@ -215,8 +215,10 @@ Normalizer.prototype.extend = function(group, selectors){
node.val = selector;
node.inherits = false;
groups.forEach(function(group){
- self.extend(group, selectors);
- group.push(node);
+ if (!group.nodes.some(function(n){ return n.val == selector })) {
+ self.extend(group, selectors);
+ group.push(node);
+ }
});
});
});
View
6 test/cases/regression.819.css
@@ -0,0 +1,6 @@
+.bar,
+.foo,
+.baz,
+.baz > li {
+ prop: val;
+}
View
10 test/cases/regression.819.styl
@@ -0,0 +1,10 @@
+.bar
+ prop val
+
+.foo
+ @extend .bar
+
+.baz
+ &,
+ > li
+ @extend .foo
Please sign in to comment.
Something went wrong with that request. Please try again.