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

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
yisibl committed Jun 3, 2015
1 parent 980afc6 commit d8455e7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,23 @@ function customSelector(options) {
})

//控制选择器是否换行
if (!options.lineBreak && options.lineBreak == false) {
line_break = ' '
if (!options.lineBreak && options.lineBreak == false) {
line_break = ' '
}

// 转换自定义的选择器别名
styles.eachRule(function(rule) {
for (var prop in customSelectors) {
if (rule.selector.indexOf(prop) >= 0) {
customSelector = customSelectors[prop]

// $2 = <extension-name> (自定义的选择器名称)
rule.selector = rule.selector.replace(re_CUSTOM_SELECTOR, function($0, $1, $2, $3) {
if ($2 === prop) {
return customSelector.split(",").map(function(selector) {
return $1 + selector.trim() + $3
}).join("," + line_break)
} else if ($2 !== prop){
} else if ($2 !== prop) {
console.log("Warning: The selector '" + $2 + "' is undefined in CSS!")
return $2
}
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/matches.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
:--buttons:matches(:focus, .is-focused) {
border: red;
display: block;
}
}
2 changes: 1 addition & 1 deletion test/fixtures/matches.expected.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ button:matches(:focus, .is-focused),
.button:matches(:focus, .is-focused) {
border: red;
display: block;
}
}

0 comments on commit d8455e7

Please sign in to comment.