wishthis/node_modules/autoprefixer/lib/hacks/user-select.js

29 lines
578 B
JavaScript
Raw Normal View History

2023-08-17 09:47:40 +00:00
let Declaration = require('../declaration')
2022-01-21 08:28:41 +00:00
2023-08-17 09:47:40 +00:00
class UserSelect extends Declaration {
/**
* Avoid prefixing all in IE
*/
insert(decl, prefix, prefixes) {
if (decl.value === 'all' && prefix === '-ms-') {
return undefined
} else {
return super.insert(decl, prefix, prefixes)
}
2022-01-21 08:28:41 +00:00
}
/**
* Change prefixed value for IE
*/
2023-08-17 09:47:40 +00:00
set(decl, prefix) {
2022-01-21 08:28:41 +00:00
if (prefix === '-ms-' && decl.value === 'contain') {
2023-08-17 09:47:40 +00:00
decl.value = 'element'
2022-01-21 08:28:41 +00:00
}
2023-08-17 09:47:40 +00:00
return super.set(decl, prefix)
}
}
2022-01-21 08:28:41 +00:00
2023-08-17 09:47:40 +00:00
UserSelect.names = ['user-select']
2022-01-21 08:28:41 +00:00
2023-08-17 09:47:40 +00:00
module.exports = UserSelect