artistic-elements
Version:
artistic web components
50 lines (49 loc) • 1.8 kB
JavaScript
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { html, css, LitElement } from 'lit';
import { customElement, property } from 'lit/decorators.js';
let ArtisticTriangleDown = class ArtisticTriangleDown extends LitElement {
constructor() {
super(...arguments);
this.widthLeft = '5rem';
this.widthRight = '5rem';
this.height = '10rem';
this.color = '#f0f';
}
render() {
const style = `
border-left: ${this.widthLeft} solid transparent;
border-right: ${this.widthRight} solid transparent;
border-top: ${this.height} solid ${this.color};
`;
return html `<div style="${style}">
<slot></slot>
</div>`;
}
};
ArtisticTriangleDown.styles = css `
div {
width: 0;
height: 0;
}
`;
__decorate([
property()
], ArtisticTriangleDown.prototype, "widthLeft", void 0);
__decorate([
property()
], ArtisticTriangleDown.prototype, "widthRight", void 0);
__decorate([
property()
], ArtisticTriangleDown.prototype, "height", void 0);
__decorate([
property()
], ArtisticTriangleDown.prototype, "color", void 0);
ArtisticTriangleDown = __decorate([
customElement('artistic-triangle-down')
], ArtisticTriangleDown);
export { ArtisticTriangleDown };