postcss-replace-overflow-wrap
Advanced tools
Comparing version
@@ -0,2 +1,6 @@ | ||
## 2.0 | ||
* Use PostCSS 6.x | ||
* Use Node 4.x syntax | ||
## 1.0 | ||
* Initial release |
22
index.js
@@ -1,19 +0,15 @@ | ||
var postcss = require('postcss'); | ||
const postcss = require('postcss'); | ||
module.exports = postcss.plugin('postcss-replace-overflow-wrap', function (opts) { | ||
module.exports = postcss.plugin('postcss-replace-overflow-wrap', (opts) => { | ||
opts = opts || {}; | ||
var method = opts.method || 'replace'; | ||
const method = opts.method || 'replace'; | ||
return function (css, result) { // eslint-disable-line no-unused-vars | ||
css.walkRules(function (rule) { | ||
rule.walkDecls(function (decl, i) { // eslint-disable-line no-unused-vars | ||
if (decl.prop === 'overflow-wrap') { | ||
decl.cloneBefore({ prop: 'word-wrap' }); | ||
if (method === 'replace') { | ||
decl.remove(); | ||
} | ||
} | ||
}); | ||
return (css) => { | ||
css.walkDecls('overflow-wrap', (decl) => { | ||
decl.cloneBefore({ prop: 'word-wrap' }); | ||
if (method === 'replace') { | ||
decl.remove(); | ||
} | ||
}); | ||
}; | ||
}); |
{ | ||
"name": "postcss-replace-overflow-wrap", | ||
"version": "1.0.0", | ||
"version": "2.0.0", | ||
"description": "PostCSS plugin to replace overflow-wrap with word-wrap or optionally retain both declarations.", | ||
@@ -19,9 +19,12 @@ "keywords": [ | ||
"homepage": "https://github.com/MattDiMu/postcss-replace-overflow-wrap", | ||
"files": [ | ||
"index.js" | ||
], | ||
"dependencies": { | ||
"postcss": "^5.0.16" | ||
"postcss": "^6.0.1" | ||
}, | ||
"devDependencies": { | ||
"ava": "^0.14.0", | ||
"eslint": "^2.1.0", | ||
"eslint-config-postcss": "^2.0.0" | ||
"ava": "^0.19.1", | ||
"eslint": "^3.19.0", | ||
"eslint-config-postcss": "^2.0.2" | ||
}, | ||
@@ -28,0 +31,0 @@ "scripts": { |
@@ -35,3 +35,2 @@ # PostCSS Replace Overflow Wrap [![Build Status][ci-img]][ci] | ||
## Usage | ||
@@ -38,0 +37,0 @@ |
Sorry, the diff of this file is not supported yet
3670
-7.14%5
-28.57%13
-23.53%47
-2.08%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated