inline-logical.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 InlineLogical = /*#__PURE__*/function (_Declaration) {
  7. _inheritsLoose(InlineLogical, _Declaration);
  8. function InlineLogical() {
  9. return _Declaration.apply(this, arguments) || this;
  10. }
  11. var _proto = InlineLogical.prototype;
  12. /**
  13. * Use old syntax for -moz- and -webkit-
  14. */
  15. _proto.prefixed = function prefixed(prop, prefix) {
  16. return prefix + prop.replace('-inline', '');
  17. }
  18. /**
  19. * Return property name by spec
  20. */
  21. ;
  22. _proto.normalize = function normalize(prop) {
  23. return prop.replace(/(margin|padding|border)-(start|end)/, '$1-inline-$2');
  24. };
  25. return InlineLogical;
  26. }(Declaration);
  27. _defineProperty(InlineLogical, "names", ['border-inline-start', 'border-inline-end', 'margin-inline-start', 'margin-inline-end', 'padding-inline-start', 'padding-inline-end', 'border-start', 'border-end', 'margin-start', 'margin-end', 'padding-start', 'padding-end']);
  28. module.exports = InlineLogical;