stylecow-plugin-matches
Advanced tools
Comparing version 2.0.0 to 3.0.0
22
index.js
module.exports = function (stylecow) { | ||
stylecow.addTask({ | ||
"Function": { | ||
":matches": function (fn) { | ||
var selector = fn.parent({type: 'Selector'}); | ||
var value = selector.toString(); | ||
var search = fn.toString(); | ||
filter: { | ||
type: 'Function', | ||
name: ':matches' | ||
}, | ||
fn: function (fn) { | ||
var selector = fn.parent('Selector'); | ||
var value = selector.toString(); | ||
var search = fn.toString(); | ||
fn.getContent().forEach(function (replace) { | ||
selector.before(new stylecow.Selector()).setContent(value.replace(search, replace)); | ||
}); | ||
fn.forEach(function (replace) { | ||
selector.before(stylecow.Selector.createFromString(value.replace(search, replace.toString()))); | ||
}); | ||
selector.remove(); | ||
} | ||
selector.remove(); | ||
} | ||
}); | ||
}; |
{ | ||
"name": "stylecow-plugin-matches", | ||
"description": "Stylecow plugin to add support for :matches() selector function to all browsers", | ||
"version": "2.0.0", | ||
"version": "3.0.0", | ||
"author": "Oscar Otero <oom@oscarotero.com>", | ||
@@ -6,0 +6,0 @@ "homepage": "https://github.com/stylecow/stylecow-plugin-matches", |
3114
17