From 489f23fc3eb627c3b324c2154b8f4f5377e79d84 Mon Sep 17 00:00:00 2001 From: Mark David Avery Date: Thu, 1 Dec 2016 09:56:45 -0800 Subject: [PATCH] fix(namespacing): no longer namespacing children of @ rules the only @ rules that are now respcted are media and supports Closes #191 --- package.json | 2 +- tests/acceptance/sass-test.js | 10 ++++++++++ tests/acceptance/scss-test.js | 18 +++++++++--------- .../app/components/sass/base-rules/styles.sass | 5 +++++ 4 files changed, 25 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 4e9aa15..5214429 100644 --- a/package.json +++ b/package.json @@ -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" }, diff --git a/tests/acceptance/sass-test.js b/tests/acceptance/sass-test.js index eefc68e..a8ae93e 100644 --- a/tests/acceptance/sass-test.js +++ b/tests/acceptance/sass-test.js @@ -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)'); + }); +}); diff --git a/tests/acceptance/scss-test.js b/tests/acceptance/scss-test.js index 44e84a0..3a4a107 100644 --- a/tests/acceptance/scss-test.js +++ b/tests/acceptance/scss-test.js @@ -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)'); + }); +}); diff --git a/tests/dummy/app/components/sass/base-rules/styles.sass b/tests/dummy/app/components/sass/base-rules/styles.sass index 814e97a..74bd027 100644 --- a/tests/dummy/app/components/sass/base-rules/styles.sass +++ b/tests/dummy/app/components/sass/base-rules/styles.sass @@ -1,3 +1,7 @@ +@mixin mixin() + &.mixin-extra + color: rgb(0, 0, 6) + .base color: rgb(0, 0, 1) @@ -15,3 +19,4 @@ span &--variant color: rgb(0, 0, 5) + @include mixin