Skip to content

Commit

Permalink
Fixed linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
antyakushev committed Jul 27, 2016
1 parent 70836fe commit 59962d5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion index.js
Expand Up @@ -25,7 +25,6 @@ module.exports = postcss.plugin('postcss-for', function (opts) {

manageIterStack = function (rule) {
if (rule.parent.type !== 'root') {
console.log('\n\nRule:\n', rule, '\n\nList:\n', list, '\n\nParent:\n', rule.parent)
var parentIterVar = rule.parent.params && list.space(rule.parent.params)[0];
if (iterStack.indexOf(parentIterVar) === -1) {
// If parent isn't in stack, wipe stack
Expand Down
10 changes: 5 additions & 5 deletions test/test.js
Expand Up @@ -50,6 +50,11 @@ describe('postcss-for', function () {
'.b--1 {\n width: -1px\n}\n.b-0 {\n width: 0px\n}');
});

it('it supports :root selector', function () {
test(':root { \n@for $weight from 100 to 900 by 100 \n{ --foo-$(weight): $weight; }\n}\n.b { font-weight: var(--foo-200) }',
'.b { font-weight: 200 }');
});

it('it throws an error on wrong syntax', function () {
expect(function () {
test('@for $i since 1 until 3 { .b-$i { width: $(i)px; } }');
Expand Down Expand Up @@ -80,9 +85,4 @@ describe('postcss-for', function () {
}).to.throw('<css input>:2:23: External variable (not from a parent for loop) cannot be used as a range parameter');
});

it('it supports :root selector', function () {
test(':root { \n@for $weight from 100 to 900 by 100 \n{ --foo-$(weight): $weight; }\n}\n.b { font-weight: var(--foo-200) }',
'.b { font-weight: 200 }');
});

});

0 comments on commit 59962d5

Please sign in to comment.