mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-31 13:07:49 +00:00
Convert label badge to use static get styles (#2480)
This commit is contained in:
parent
f98fff9ffd
commit
d8d77d0238
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user