import { PolymerElement, html } from '@polymer/poymer/polymer-element.js';
class JTGCheckbox extends PolymerElement {
constructor() {
super();
}
static get template() {
return
html`
<style>
:host {
display: inline-block;
font-family: 'Roboto';
}
#checkbox-container {
border: 2px solid black;
width: 20px;
height: 20px;
margin-right: 8px;
border-radius: 5px;
background-color: var(--jtg-checkbox-unchecked-and-background-color, white);
}
#inner-container {
width: 16px;
height: 16px;
text-align: center;
vertical-align: middle;
margin: 2px;
border-radius: 3px;
background-color: var(--jtg-checkbox-unchecked-and-background-color, white);
}
:host([aria-checked="true"]) #inner-container {
animation-name: checkedAnimation;
animation-duration: 0.5s;
background-color: var(--jtg-checkbox-checked-color, green);
}
#checkbox-label {
font-size: var(--jtg-checkbox-font-size, 20px);
overflow-wrap: break-word;
}
#checkbox-label, #checkbox-container {
display: inline-block;
vertical-align: middle;
}
@keyframes checkedAnimation {
from {
background-color: var(--jtg-checkbox-unchecked-and-background-color, white);
}
to {
background-color: var(--jtg-checkbox-checked-color, green);
}
}
</style>
<div id="checkbox-container">
<div id="inner-container"></div>
</div>
<div id="checkbox-label"><slot></slot></div>
`;
}
}
window.customElements.define('jtg-checkbox', JTGCheckbox);