Skip to content

Commit

Permalink
fix(namespacing): no longer namespacing children of @ rules
Browse files Browse the repository at this point in the history
the only @ rules that are now respcted are media and supports
Closes #191
  • Loading branch information
webark committed Dec 1, 2016
1 parent 40113e6 commit 489f23f
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"postcss": "^5.2.6",
"postcss-less": "^0.15.0",
"postcss-scss": "^0.4.0",
"postcss-selector-namespace": "^1.2.4",
"postcss-selector-namespace": "^1.2.8",
"rsvp": "^3.2.1",
"walk-sync": "^0.3.1"
},
Expand Down
10 changes: 10 additions & 0 deletions tests/acceptance/sass-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,13 @@ test('BEM variant rule followed', function(assert) {
assert.equal(find('[class$=__element--variant]').css('color'), 'rgb(0, 0, 5)');
});
});

test('mixin psudo elements do not get scoped', function(assert) {
visit(`/${TYPE}`);

andThen(function() {
let item = find('[class$=__element--variant]');
item.addClass('mixin-extra');
assert.equal(item.css('color'), 'rgb(0, 0, 6)');
});
});
18 changes: 9 additions & 9 deletions tests/acceptance/scss-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ test('BEM variant rule followed', function(assert) {
});
});

// test('mixin psudo elements do not get scoped', function(assert) {
// visit(`/${TYPE}`);
//
// andThen(function() {
// let item = find('[class$=__element--variant]');
// item.addClass('mixin-extra');
// assert.equal(item.css('color'), 'rgb(0, 0, 6)');
// });
// });
test('mixin psudo elements do not get scoped', function(assert) {
visit(`/${TYPE}`);

andThen(function() {
let item = find('[class$=__element--variant]');
item.addClass('mixin-extra');
assert.equal(item.css('color'), 'rgb(0, 0, 6)');
});
});
5 changes: 5 additions & 0 deletions tests/dummy/app/components/sass/base-rules/styles.sass
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
@mixin mixin()
&.mixin-extra
color: rgb(0, 0, 6)

.base
color: rgb(0, 0, 1)

Expand All @@ -15,3 +19,4 @@ span

&--variant
color: rgb(0, 0, 5)
@include mixin

0 comments on commit 489f23f

Please sign in to comment.