Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Now allowing namespaceing of rules deinfed inside of a scss @ for rule #217

Merged
merged 1 commit into from
Feb 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
/* eslint-env node */
'use strict';

var EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
let EmberAddon = require('ember-cli/lib/broccoli/ember-addon');

module.exports = function(defaults) {
var app = new EmberAddon(defaults, {
// Add options here
let app = new EmberAddon(defaults, {
"ember-cli-babel": {
includePolyfill: true
},
});

/*
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"eslint-plugin-ember-suave": "^1.0.0",
"loader.js": "^4.0.10",
"no-style-files-yet": "file:./tests/dummy/lib/no-style-files-yet",
"postcss-selector-namespace": "^1.3.0",
"second-test-addon": "file:./tests/dummy/lib/second-test-addon",
"test-addon": "file:./tests/dummy/lib/test-addon"
},
Expand Down
11 changes: 11 additions & 0 deletions tests/acceptance/scss-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,14 @@ test('mixin psudo elements do not get scoped', function(assert) {
assert.equal(item.css('color'), 'rgb(0, 0, 6)');
});
});

test('children of root @for rules are namspaced', function(assert) {
visit(`/${TYPE}`);

andThen(function() {
for (let index of Array(10).keys()) {
let item = find(`[class$=__element--${index}]`);
assert.equal(item.css('color'), `rgb(0, 0, ${index})`);
}
});
});
9 changes: 9 additions & 0 deletions tests/dummy/app/components/scss/for-loop/component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import Ember from 'ember';

const {
Component,
} = Ember;

export default Component.extend({
items: [...Array(10).keys()],
});
5 changes: 5 additions & 0 deletions tests/dummy/app/components/scss/for-loop/styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@for $index from 0 through 9 {
&__element--#{$index} {
color: rgb(0, 0, $index);
}
}
3 changes: 3 additions & 0 deletions tests/dummy/app/components/scss/for-loop/template.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{#each items as |item|}}
<span class="{{componentCssClassName}}__element--{{item}}"></span>
{{/each}}
1 change: 1 addition & 0 deletions tests/dummy/app/scss/template.hbs
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
{{scss/base-rules}}
{{scss/for-loop}}