Skip to content
This repository was archived by the owner on Jun 6, 2022. It is now read-only.

Commit d8455e7

Browse files
committed
Format code
1 parent 980afc6 commit d8455e7

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -49,23 +49,23 @@ function customSelector(options) {
4949
})
5050

5151
//控制选择器是否换行
52-
if (!options.lineBreak && options.lineBreak == false) {
53-
line_break = ' '
52+
if (!options.lineBreak && options.lineBreak == false) {
53+
line_break = ' '
5454
}
5555

5656
// 转换自定义的选择器别名
5757
styles.eachRule(function(rule) {
5858
for (var prop in customSelectors) {
5959
if (rule.selector.indexOf(prop) >= 0) {
6060
customSelector = customSelectors[prop]
61-
61+
6262
// $2 = <extension-name> (自定义的选择器名称)
6363
rule.selector = rule.selector.replace(re_CUSTOM_SELECTOR, function($0, $1, $2, $3) {
6464
if ($2 === prop) {
6565
return customSelector.split(",").map(function(selector) {
6666
return $1 + selector.trim() + $3
6767
}).join("," + line_break)
68-
} else if ($2 !== prop){
68+
} else if ($2 !== prop) {
6969
console.log("Warning: The selector '" + $2 + "' is undefined in CSS!")
7070
return $2
7171
}

test/fixtures/matches.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
:--buttons:matches(:focus, .is-focused) {
99
border: red;
1010
display: block;
11-
}
11+
}

test/fixtures/matches.expected.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ button:matches(:focus, .is-focused),
88
.button:matches(:focus, .is-focused) {
99
border: red;
1010
display: block;
11-
}
11+
}

0 commit comments

Comments
 (0)