Skip to content

Commit 489f23f

Browse files
committed
fix(namespacing): no longer namespacing children of @ rules
the only @ rules that are now respcted are media and supports Closes #191
1 parent 40113e6 commit 489f23f

4 files changed

Lines changed: 25 additions & 10 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"postcss": "^5.2.6",
3535
"postcss-less": "^0.15.0",
3636
"postcss-scss": "^0.4.0",
37-
"postcss-selector-namespace": "^1.2.4",
37+
"postcss-selector-namespace": "^1.2.8",
3838
"rsvp": "^3.2.1",
3939
"walk-sync": "^0.3.1"
4040
},

tests/acceptance/sass-test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,13 @@ test('BEM variant rule followed', function(assert) {
4444
assert.equal(find('[class$=__element--variant]').css('color'), 'rgb(0, 0, 5)');
4545
});
4646
});
47+
48+
test('mixin psudo elements do not get scoped', function(assert) {
49+
visit(`/${TYPE}`);
50+
51+
andThen(function() {
52+
let item = find('[class$=__element--variant]');
53+
item.addClass('mixin-extra');
54+
assert.equal(item.css('color'), 'rgb(0, 0, 6)');
55+
});
56+
});

tests/acceptance/scss-test.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ test('BEM variant rule followed', function(assert) {
4545
});
4646
});
4747

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

tests/dummy/app/components/sass/base-rules/styles.sass

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
@mixin mixin()
2+
&.mixin-extra
3+
color: rgb(0, 0, 6)
4+
15
.base
26
color: rgb(0, 0, 1)
37

@@ -15,3 +19,4 @@ span
1519

1620
&--variant
1721
color: rgb(0, 0, 5)
22+
@include mixin

0 commit comments

Comments
 (0)