Skip to content

Commit 472a405

Browse files
committed
fix indentation
1 parent ac1db56 commit 472a405

File tree

3 files changed

+27
-27
lines changed

3 files changed

+27
-27
lines changed

lib/generate-descendant-pieces-from-selector.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ var RE_SELECTOR_SEPARATOR = /(([\.#]?)[^\.#]+)/g;
99

1010
// Helper function to get all combination of a text array
1111
var getCombinations = function(strings) {
12-
var result = [];
13-
var f = function(prefix, strings) {
14-
for (var i = 0; i < strings.length; i++) {
15-
result.push(prefix + strings[i]);
16-
f(prefix + strings[i], strings.slice(i + 1));
17-
}
18-
}
19-
f('', strings);
20-
return result;
12+
var result = [];
13+
var f = function(prefix, strings) {
14+
for (var i = 0; i < strings.length; i++) {
15+
result.push(prefix + strings[i]);
16+
f(prefix + strings[i], strings.slice(i + 1));
17+
}
18+
}
19+
f('', strings);
20+
return result;
2121
}
2222

2323
var generateDescendantPiecesFromSelector = function(selector) {
@@ -41,10 +41,10 @@ var generateDescendantPiecesFromSelector = function(selector) {
4141
// a.b#c => [a, .b, #c]
4242
var pieces = piece.match(RE_SELECTOR_SEPARATOR);
4343
// [a, .b, #c] => [a, a.b, a.b#c, a#c, .b, .b#c, #c]
44-
var combinations = getCombinations(pieces);
44+
var combinations = getCombinations(pieces);
4545
result = result.concat(combinations);
46-
return result;
47-
}, []);
46+
return result;
47+
}, []);
4848
};
4949

5050
module.exports = generateDescendantPiecesFromSelector;

test/fixtures/chained-selector.css

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
button {
2-
--width-small: 50px;
2+
--width-small: 50px;
33
}
44

55
button.custom {
6-
--width-small: 100px;
7-
--width-medium: 200px;
8-
--width-large: 300px;
9-
--font-size: 12px;
6+
--width-small: 100px;
7+
--width-medium: 200px;
8+
--width-large: 300px;
9+
--font-size: 12px;
1010
}
1111

1212
button.rounded.small {
13-
width: var(--width-small);
13+
width: var(--width-small);
1414
}
1515

1616
button.custom.large {
17-
width: var(--width-large);
17+
width: var(--width-large);
1818
}
1919

2020
button.rounded.custom.medium {
21-
width: var(--width-medium);
21+
width: var(--width-medium);
2222
}
2323

2424
button#id.rounded.custom.medium {
25-
width: var(--width-medium);
25+
width: var(--width-medium);
2626
}
2727

2828
button.small.pill.custom {
29-
width: var(--width-small);
29+
width: var(--width-small);
3030
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
button.rounded.small {
2-
width: 50px;
2+
width: 50px;
33
}
44

55
button.custom.large {
6-
width: 300px;
6+
width: 300px;
77
}
88

99
button.rounded.custom.medium {
10-
width: 200px;
10+
width: 200px;
1111
}
1212

1313
button#id.rounded.custom.medium {
14-
width: 200px;
14+
width: 200px;
1515
}
1616

1717
button.small.pill.custom {
18-
width: 100px;
18+
width: 100px;
1919
}

0 commit comments

Comments
 (0)