wishthis/node_modules/autoprefixer/lib/hacks/background-size.js

24 lines
516 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 BackgroundSize extends Declaration {
2022-01-21 08:28:41 +00:00
/**
* Duplication parameter for -webkit- browsers
*/
2023-08-17 09:47:40 +00:00
set(decl, prefix) {
let value = decl.value.toLowerCase()
if (
prefix === '-webkit-' &&
!value.includes(' ') &&
value !== 'contain' &&
value !== 'cover'
) {
decl.value = decl.value + ' ' + decl.value
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
BackgroundSize.names = ['background-size']
2022-01-21 08:28:41 +00:00
2023-08-17 09:47:40 +00:00
module.exports = BackgroundSize