UNPKG

artistic-elements

Version:
76 lines (73 loc) 1.69 kB
import { __decorateClass, e, e2, i, s, y } from "./chunk.FMUK5F65.js"; // src/artistic/rectangle.ts var ArtisticRectangle = class extends s { constructor() { super(...arguments); this.width = "10rem"; this.height = "10rem"; this.color = "#f0f"; this.top = "0"; this.left = "0"; this.align = "initial"; this["border-radius"] = "0"; } render() { const style = ` width: ${this.width}; height: ${this.height}; background: ${this.color}; align-self: ${this.align}; ${this.top !== "0" || this.left !== "0" ? "position: absolute;" : ""} ${this.top !== "0" ? `top: ${this.top};` : ""} ${this.left !== "0" ? `left: ${this.left};` : ""} ${this["border-radius"] !== "0" ? `border-radius: ${this["border-radius"]};` : ""} `; return y`<div style="${style}"> <slot></slot> </div>`; } }; ArtisticRectangle.styles = i` :host { display: contents; } div { display: flex; align-items: center; justify-content: center; } `; __decorateClass([ e2() ], ArtisticRectangle.prototype, "width", 2); __decorateClass([ e2() ], ArtisticRectangle.prototype, "height", 2); __decorateClass([ e2() ], ArtisticRectangle.prototype, "color", 2); __decorateClass([ e2() ], ArtisticRectangle.prototype, "top", 2); __decorateClass([ e2() ], ArtisticRectangle.prototype, "left", 2); __decorateClass([ e2() ], ArtisticRectangle.prototype, "align", 2); __decorateClass([ e2() ], ArtisticRectangle.prototype, "border-radius", 2); ArtisticRectangle = __decorateClass([ e("artistic-rectangle") ], ArtisticRectangle); export { ArtisticRectangle };