Skip to content

Commit 6e6b935

Browse files
committed
Use walkDecls without walkRules
1 parent 246775e commit 6e6b935

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

index.js

+6-8
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@ module.exports = postcss.plugin('postcss-replace-overflow-wrap', function (opts)
55
var method = opts.method || 'replace';
66

77
return function (css, result) { // eslint-disable-line no-unused-vars
8-
css.walkRules(function (rule) {
9-
rule.walkDecls(function (decl, i) { // eslint-disable-line no-unused-vars
10-
if (decl.prop === 'overflow-wrap') {
11-
decl.cloneBefore({ prop: 'word-wrap' });
12-
if (method === 'replace') {
13-
decl.remove();
14-
}
8+
css.walkDecls(function (decl, i) { // eslint-disable-line no-unused-vars
9+
if (decl.prop === 'overflow-wrap') {
10+
decl.cloneBefore({ prop: 'word-wrap' });
11+
if (method === 'replace') {
12+
decl.remove();
1513
}
16-
});
14+
}
1715
});
1816
};
1917
});

0 commit comments

Comments
 (0)