image-set.js 395 B

123456789101112131415161718
  1. let Value = require('../value')
  2. class ImageSet extends Value {
  3. /**
  4. * Use non-standard name for WebKit and Firefox
  5. */
  6. replace(string, prefix) {
  7. let fixed = super.replace(string, prefix)
  8. if (prefix === '-webkit-') {
  9. fixed = fixed.replace(/("[^"]+"|'[^']+')(\s+\d+\w)/gi, 'url($1)$2')
  10. }
  11. return fixed
  12. }
  13. }
  14. ImageSet.names = ['image-set']
  15. module.exports = ImageSet