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.

63 lines
2.1 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 BorderRadius =
  7. /*#__PURE__*/
  8. function (_Declaration) {
  9. _inheritsLoose(BorderRadius, _Declaration);
  10. function BorderRadius() {
  11. return _Declaration.apply(this, arguments) || this;
  12. }
  13. var _proto = BorderRadius.prototype;
  14. /**
  15. * Change syntax, when add Mozilla prefix
  16. */
  17. _proto.prefixed = function prefixed(prop, prefix) {
  18. if (prefix === '-moz-') {
  19. return prefix + (BorderRadius.toMozilla[prop] || prop);
  20. }
  21. return _Declaration.prototype.prefixed.call(this, prop, prefix);
  22. }
  23. /**
  24. * Return unprefixed version of property
  25. */
  26. ;
  27. _proto.normalize = function normalize(prop) {
  28. return BorderRadius.toNormal[prop] || prop;
  29. };
  30. return BorderRadius;
  31. }(Declaration);
  32. _defineProperty(BorderRadius, "names", ['border-radius']);
  33. _defineProperty(BorderRadius, "toMozilla", {});
  34. _defineProperty(BorderRadius, "toNormal", {});
  35. for (var _i = 0, _arr = ['top', 'bottom']; _i < _arr.length; _i++) {
  36. var ver = _arr[_i];
  37. for (var _i2 = 0, _arr2 = ['left', 'right']; _i2 < _arr2.length; _i2++) {
  38. var hor = _arr2[_i2];
  39. var normal = "border-" + ver + "-" + hor + "-radius";
  40. var mozilla = "border-radius-" + ver + hor;
  41. BorderRadius.names.push(normal);
  42. BorderRadius.names.push(mozilla);
  43. BorderRadius.toMozilla[normal] = mozilla;
  44. BorderRadius.toNormal[mozilla] = normal;
  45. }
  46. }
  47. module.exports = BorderRadius;