postcss-touch-callout
Version:
PostCSS plugin to add -touch-callout prefix
23 lines (20 loc) • 553 B
JavaScript
var postcss = require('postcss');
var map = {
'none': 'none',
'auto': 'default',
'text': 'default',
'contain': 'default',
'all': 'default',
'inherit': 'inherit',
'initial': 'initial',
'unset': 'unset'
};
module.exports = postcss.plugin('postcss-touch-callout', function() {
return function(root) {
root.walkDecls('user-select', function(decl) {
if (decl.value in map) {
decl.parent.prepend({prop: '-webkit-touch-callout', value: map[decl.value]})
}
})
}
});