You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
721 B
26 lines
721 B
import postcss from 'postcss';
|
|
|
|
const selectorRegExp = /:blank([^\w-]|$)/gi;
|
|
var postcss$1 = postcss.plugin('css-blank-pseudo', opts => {
|
|
const replaceWith = String(Object(opts).replaceWith || '[blank]');
|
|
const preserve = Boolean('preserve' in Object(opts) ? opts.preserve : true);
|
|
return root => {
|
|
root.walkRules(selectorRegExp, rule => {
|
|
const selector = rule.selector.replace(selectorRegExp, ($0, $1) => {
|
|
return `${replaceWith}${$1}`;
|
|
});
|
|
const clone = rule.clone({
|
|
selector
|
|
});
|
|
|
|
if (preserve) {
|
|
rule.before(clone);
|
|
} else {
|
|
rule.replaceWith(clone);
|
|
}
|
|
});
|
|
};
|
|
});
|
|
|
|
export default postcss$1;
|
|
//# sourceMappingURL=postcss.mjs.map
|
|
|