Convert label badge to use static get styles (#2480)

This commit is contained in:
Paulus Schoutsen 2019-01-14 19:32:33 -08:00 committed by GitHub
parent f98fff9ffd
commit d8d77d0238
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,6 +4,8 @@ import {
PropertyDeclarations,
PropertyValues,
TemplateResult,
CSSResult,
css,
} from "lit-element";
import { classMap } from "lit-html/directives/class-map";
import "./ha-icon";
@ -27,7 +29,6 @@ class HaLabelBadge extends LitElement {
protected render(): TemplateResult | void {
return html`
${this.renderStyle()}
<div class="badge-container">
<div class="label-badge" id="badge">
<div
@ -78,9 +79,9 @@ class HaLabelBadge extends LitElement {
`;
}
protected renderStyle(): TemplateResult {
return html`
<style>
static get styles(): CSSResult[] {
return [
css`
.badge-container {
display: inline-block;
text-align: center;
@ -149,8 +150,8 @@ class HaLabelBadge extends LitElement {
text-overflow: ellipsis;
line-height: normal;
}
</style>
`;
`,
];
}
protected updated(changedProperties: PropertyValues): void {