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.

37 lines
1.4 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 BASIC = ['none', 'underline', 'overline', 'line-through', 'blink', 'inherit', 'initial', 'unset'];
  7. var TextDecoration =
  8. /*#__PURE__*/
  9. function (_Declaration) {
  10. _inheritsLoose(TextDecoration, _Declaration);
  11. function TextDecoration() {
  12. return _Declaration.apply(this, arguments) || this;
  13. }
  14. var _proto = TextDecoration.prototype;
  15. /**
  16. * Do not add prefixes for basic values.
  17. */
  18. _proto.check = function check(decl) {
  19. return decl.value.split(/\s+/).some(function (i) {
  20. return !BASIC.includes(i);
  21. });
  22. };
  23. return TextDecoration;
  24. }(Declaration);
  25. _defineProperty(TextDecoration, "names", ['text-decoration']);
  26. module.exports = TextDecoration;