You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.5 KiB

4 years ago
  1. "use strict";
  2. function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
  3. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _defaults(subClass, superClass); }
  4. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  5. var Declaration = require('../declaration');
  6. var BackgroundSize =
  7. /*#__PURE__*/
  8. function (_Declaration) {
  9. _inheritsLoose(BackgroundSize, _Declaration);
  10. function BackgroundSize() {
  11. return _Declaration.apply(this, arguments) || this;
  12. }
  13. var _proto = BackgroundSize.prototype;
  14. /**
  15. * Duplication parameter for -webkit- browsers
  16. */
  17. _proto.set = function set(decl, prefix) {
  18. var value = decl.value.toLowerCase();
  19. if (prefix === '-webkit-' && !value.includes(' ') && value !== 'contain' && value !== 'cover') {
  20. decl.value = decl.value + ' ' + decl.value;
  21. }
  22. return _Declaration.prototype.set.call(this, decl, prefix);
  23. };
  24. return BackgroundSize;
  25. }(Declaration);
  26. _defineProperty(BackgroundSize, "names", ['background-size']);
  27. module.exports = BackgroundSize;