dees-wcctools/test/elements/test-demoelement.ts

39 lines
1.1 KiB
TypeScript
Raw Normal View History

2020-11-27 16:40:38 +00:00
import { DeesElement, customElement, TemplateResult, html } from '@designestate/dees-element';
2020-11-26 02:28:17 +00:00
import * as domtools from '@designestate/dees-domtools';
@customElement('test-demoelement')
2020-11-27 16:40:38 +00:00
export class TestDemoelement extends DeesElement {
2020-11-26 02:28:17 +00:00
public static demo = () => html`<test-demoelement></test-demoelement>`;
public render() {
return html`
<style>
2020-11-27 16:40:38 +00:00
.maincontainer, .themeindicator {
2020-11-26 02:28:17 +00:00
display: block;
padding: 10px;
border-radius: 10px;
2020-11-27 16:40:38 +00:00
margin-bottom: 20px;
2020-11-26 02:28:17 +00:00
}
2020-11-27 16:40:38 +00:00
.maincontainer {
color: #fff;
2020-11-26 02:28:17 +00:00
background: #000;
2020-11-27 16:40:38 +00:00
}
.themeindicator {
color: ${this.goBright ? '#000' : '#fff'};
background: ${this.goBright ? '#fff' : '#000'};
}
${domtools.breakpoints.cssForPhablet(`
.maincontainer, .themeindicator {
border-radius: 50px;
2020-11-26 02:28:17 +00:00
}
`)}
2020-11-26 02:50:50 +00:00
</style>
2020-11-27 16:40:38 +00:00
<div class="maincontainer"><slot>This is a demo element</slot></div>
<div class="themeindicator">
You have selected the ${this.goBright ? 'bright' : 'dark'} theme;
</div>
2020-11-26 02:28:17 +00:00
`;
}
2020-11-26 02:50:50 +00:00
}