Skip to content

Commit 76a5e79

Browse files
authored
Merge pull request #184 from GitScrum/milestone-0.1.4
Milestone 0.1.4
2 parents d4e4a66 + 40f1767 commit 76a5e79

File tree

5 files changed

+29
-4
lines changed

5 files changed

+29
-4
lines changed

changelog.md

+11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
<a name="0.1.4"></a>
2+
## 0.1.4 (2018-01-22)
3+
4+
* 0.1.4 ([c39cf5a](https://github.com/gitscrum/postcss-at-rules-variables/commit/c39cf5a))
5+
* fix: issue #183 ([9edfd7c](https://github.com/gitscrum/postcss-at-rules-variables/commit/9edfd7c)), closes [#183](https://github.com/gitscrum/postcss-at-rules-variables/issues/183)
6+
* test: for issue #183 ([7152277](https://github.com/gitscrum/postcss-at-rules-variables/commit/7152277)), closes [#183](https://github.com/gitscrum/postcss-at-rules-variables/issues/183)
7+
* test: for issue #183 with rule ([1bce741](https://github.com/gitscrum/postcss-at-rules-variables/commit/1bce741)), closes [#183](https://github.com/gitscrum/postcss-at-rules-variables/issues/183)
8+
* build: update changelog ([6d1c8bf](https://github.com/gitscrum/postcss-at-rules-variables/commit/6d1c8bf))
9+
10+
11+
112
<a name="0.1.3"></a>
213
## 0.1.3 (2018-01-17)
314

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "postcss-at-rules-variables",
3-
"version": "0.1.3",
3+
"version": "0.1.4",
44
"description": "PostCss plugin to use CSS Custom Properties in at-rule @each, @for, @if, @else ",
55
"license": "MIT",
66
"repository": "gitscrum/postcss-at-rules-variables",

src/index.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ function getProperty(nodes) {
1616
return;
1717
}
1818

19-
rule.each(({prop, value}) => {
20-
propertys[prop] = value;
19+
rule.each(({type, prop, value}) => {
20+
if (type === 'decl') {
21+
propertys[prop] = value;
22+
}
2123
});
2224
});
2325

test/test.js

+12
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@ test('it change circular reference', t => {
1212
t.is(processing(value), expected);
1313
});
1414

15+
test('it should not throw error if comment exists', t => {
16+
const expected = ':root{ --from: 1; /* comment */ }';
17+
const value = ':root{ --from: 1; /* comment */ }';
18+
t.is(processing(value), expected);
19+
});
20+
21+
test('it should not throw error if comment exists with rule', t => {
22+
const expected = ':root{ --from: 1; /* comment */ } @for $i from 1 to 2';
23+
const value = ':root{ --from: 1; /* comment */ } @for $i from var(--from) to 2';
24+
t.is(processing(value), expected);
25+
});
26+
1527
test('it change first properties for @for', t => {
1628
const expected = ':root{ --from: 1; } @for $i from 1 to 2';
1729
const value = ':root{ --from: 1; } @for $i from var(--from) to 2';

0 commit comments

Comments
 (0)