GoScrobble/web/node_modules/postcss-replace-overflow-wrap/index.js

16 lines
381 B
JavaScript
Raw Normal View History

2022-04-25 02:47:15 +00:00
var postcss = require('postcss')
module.exports = postcss.plugin('postcss-replace-overflow-wrap', function (opts) {
opts = opts || {}
var method = opts.method || 'replace'
return function (css) {
css.walkDecls('overflow-wrap', function (decl) {
decl.cloneBefore({ prop: 'word-wrap' })
if (method === 'replace') {
decl.remove()
}
})
}
})