zeplin-extension-style-kit
Version:
Models and utilities to generate CSS-like style code in Zeplin extensions.
56 lines (45 loc) • 1.85 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _constants = require("../constants");
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
var Border = /*#__PURE__*/function () {
function Border(_ref) {
var style = _ref.style,
width = _ref.width,
color = _ref.color;
_classCallCheck(this, Border);
this.style = style;
this.width = width;
this.color = color;
}
_createClass(Border, [{
key: "equals",
value: function equals(other) {
var style = this.style,
width = this.width,
color = this.color;
return other.style === style && other.width.equals(width) && other.color.equals(color);
}
}, {
key: "getValue",
value: function getValue(params, variables) {
var style = this.style,
width = this.width,
color = this.color;
return "".concat(style, " ").concat(width.toStyleValue(params), " ").concat(color.toStyleValue(params, variables));
}
}, {
key: "name",
get: function get() {
return _constants.STYLE_PROPS.BORDER;
}
}]);
return Border;
}();
var _default = Border;
exports.default = _default;
;