background-clip.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 utils = require('../utils');
  7. var BackgroundClip = /*#__PURE__*/function (_Declaration) {
  8. _inheritsLoose(BackgroundClip, _Declaration);
  9. function BackgroundClip(name, prefixes, all) {
  10. var _this;
  11. _this = _Declaration.call(this, name, prefixes, all) || this;
  12. if (_this.prefixes) {
  13. _this.prefixes = utils.uniq(_this.prefixes.map(function (i) {
  14. return i === '-ms-' ? '-webkit-' : i;
  15. }));
  16. }
  17. return _this;
  18. }
  19. var _proto = BackgroundClip.prototype;
  20. _proto.check = function check(decl) {
  21. return decl.value.toLowerCase() === 'text';
  22. };
  23. return BackgroundClip;
  24. }(Declaration);
  25. _defineProperty(BackgroundClip, "names", ['background-clip']);
  26. module.exports = BackgroundClip;