figgo
Version:
A CLI tool make your design tokens stay up to date with your Figma design styleguide
27 lines • 818 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
class Spacing {
constructor(name, value) {
this.name = name;
this.value = value;
}
get uppercaseName() {
return this.name.replace(/\s+/g, "_").toUpperCase();
}
get lowercaseName() {
return this.name.replace(/\s+/g, "-").toLowerCase();
}
get scss() {
return `$${this.uppercaseName}: ${this.value.toFixed(2)}px;`;
}
get js() {
const name = this.uppercaseName.replace(/-/g, "_");
return `export const ${name} = '${this.value.toFixed(2)}px';`;
}
get css() {
const name = this.lowercaseName.replace(/_/g, "-");
return `--${name}: ${this.value.toFixed(2)}px;`;
}
}
exports.default = Spacing;
//# sourceMappingURL=spacing.js.map