index.js 381 B

123456789101112131415
  1. var postcss = require('postcss')
  2. module.exports = postcss.plugin('postcss-replace-overflow-wrap', function (opts) {
  3. opts = opts || {}
  4. var method = opts.method || 'replace'
  5. return function (css) {
  6. css.walkDecls('overflow-wrap', function (decl) {
  7. decl.cloneBefore({ prop: 'word-wrap' })
  8. if (method === 'replace') {
  9. decl.remove()
  10. }
  11. })
  12. }
  13. })