background-size.js 516 B

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