Skip to content

Commit 3bed0f5

Browse files
committed
block-indent: at-rule opening brace fix
1 parent 4e720cc commit 3bed0f5

File tree

4 files changed

+6
-11
lines changed

4 files changed

+6
-11
lines changed

lib/options/block-indent.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,11 @@ module.exports = {
5151

5252
space = node[i - 1];
5353
if (!space || space[0] !== 's') {
54+
var tail = node.splice(i);
5455
space = ['s', ''];
55-
if (i) {
56-
var tail = node.splice(i);
57-
tail.unshift(space);
58-
Array.prototype.push.apply(node, tail);
59-
i++;
60-
}
56+
tail.unshift(space);
57+
Array.prototype.push.apply(node, tail);
58+
i++;
6159
}
6260
space[1] = space[1].replace(/(\n)?([\t ]+)?$/, value);
6361
}

test/block-indent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe('options/block-indent', function() {
2323
it('True Boolean value should set 4 spaces indent', function() {
2424
comb.configure({ 'block-indent': true });
2525
assert.equal(
26-
comb.processString(' \n a { color: red } @media all { .input__control { color: #000;\n}\n}'),
26+
comb.processString(' \n a { color: red } @media all {.input__control { color: #000;\n}\n}'),
2727
' \na { color: red \n}\n@media all {\n .input__control { color: #000;\n }\n}'
2828
);
2929
});

test/integral.expect.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/* foobar */
22
@media all and (min-width:0)
33
{
4-
/* :before — бордер */
54
.radio-button_theme_normal .radio-button__radio:before
65
{
76
background: rgba(0,0,0,.4);

test/integral.origin.css

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
/* foobar */
2-
@media all and (min-width:0px) {
3-
/* :before — бордер */
4-
.radio-button_theme_normal .radio-button__radio:before
2+
@media all and (min-width:0px) {.radio-button_theme_normal .radio-button__radio:before
53
{
64
background: rgba(0,0,0,0.4);
75
background: -webkit-linear-gradient(top, rgba(0,0,0,0.2) 0,rgba(0,0,0,0.4) 100%);

0 commit comments

Comments
 (0)