| 1 | let Declaration = require('../declaration') |
| 2 | |
| 3 | class BackgroundSize extends Declaration { |
| 4 | /** |
| 5 | * Duplication parameter for -webkit- browsers |
| 6 | */ |
| 7 | set(decl, prefix) { |
| 8 | let value = decl.value.toLowerCase() |
| 9 | if ( |
| 10 | prefix === '-webkit-' && |
| 11 | !value.includes(' ') && |
| 12 | value !== 'contain' && |
| 13 | value !== 'cover' |
| 14 | ) { |
| 15 | decl.value = decl.value + ' ' + decl.value |
| 16 | } |
| 17 | return super.set(decl, prefix) |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | BackgroundSize.names = ['background-size'] |
| 22 | |
| 23 | module.exports = BackgroundSize |