rework-matches
Advanced tools
Comparing version 0.0.4 to 0.0.5
10
index.js
@@ -25,2 +25,6 @@ var COMMA_PLACEHOLDER = '&'; | ||
function isNotMatchesSelector(selector) { | ||
return selector.indexOf(':matches(') === -1; | ||
} | ||
return function(style) { | ||
@@ -38,5 +42,6 @@ style.rules.forEach(function replaceMatches(rule) { | ||
// :matches(...) selector gets munged. | ||
var actualSelectors = rule.selectors.join(',').replace(/:matches\(.*\)/g, function(substr) { | ||
var actualSelectors = rule.selectors.join(',').replace(/:matches\(.*?\)/g, function(substr) { | ||
return substr.replace(/,/g, COMMA_PLACEHOLDER); | ||
}).split(','); | ||
rule.selectors = actualSelectors; | ||
@@ -68,8 +73,9 @@ rule.selectors.forEach(function findMatchesSelector(selector, i) { | ||
rule.selectors.splice(i, 1); | ||
addCartesianSelectors(selector, matches, values, rule.selectors); | ||
} | ||
}); | ||
rule.selectors = rule.selectors.filter(isNotMatchesSelector); | ||
}); | ||
}; | ||
}; |
{ | ||
"name": "rework-matches", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "A rework plugin for the :matches CSS pseudo-selector.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6266
155