zeplin-extension-style-kit
Version:
Models and utilities to generate CSS-like style code in Zeplin extensions.
58 lines (47 loc) • 1.75 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 FontSize = /*#__PURE__*/function () {
function FontSize(value) {
_classCallCheck(this, FontSize);
this.value = value;
}
_createClass(FontSize, [{
key: "hasDefaultValue",
value: function hasDefaultValue() {
return this.value === FontSize.DEFAULT_VALUE;
}
}, {
key: "equals",
value: function equals(other) {
return this.value.equals(other.value);
}
}, {
key: "getValue",
value: function getValue(params, variables) {
if (this.hasDefaultValue()) {
return FontSize.DEFAULT_VALUE;
}
return this.value.toStyleValue(params, variables);
}
}, {
key: "name",
get: function get() {
return _constants.STYLE_PROPS.FONT_SIZE;
}
}], [{
key: "DEFAULT_VALUE",
get: function get() {
return "normal";
}
}]);
return FontSize;
}();
var _default = FontSize;
exports.default = _default;
;