mirror of
https://github.com/home-assistant/frontend.git
synced 2025-08-01 05:27:46 +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,
|
PropertyDeclarations,
|
||||||
PropertyValues,
|
PropertyValues,
|
||||||
TemplateResult,
|
TemplateResult,
|
||||||
|
CSSResult,
|
||||||
|
css,
|
||||||
} from "lit-element";
|
} from "lit-element";
|
||||||
import { classMap } from "lit-html/directives/class-map";
|
import { classMap } from "lit-html/directives/class-map";
|
||||||
import "./ha-icon";
|
import "./ha-icon";
|
||||||
@ -27,7 +29,6 @@ class HaLabelBadge extends LitElement {
|
|||||||
|
|
||||||
protected render(): TemplateResult | void {
|
protected render(): TemplateResult | void {
|
||||||
return html`
|
return html`
|
||||||
${this.renderStyle()}
|
|
||||||
<div class="badge-container">
|
<div class="badge-container">
|
||||||
<div class="label-badge" id="badge">
|
<div class="label-badge" id="badge">
|
||||||
<div
|
<div
|
||||||
@ -78,9 +79,9 @@ class HaLabelBadge extends LitElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected renderStyle(): TemplateResult {
|
static get styles(): CSSResult[] {
|
||||||
return html`
|
return [
|
||||||
<style>
|
css`
|
||||||
.badge-container {
|
.badge-container {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@ -149,8 +150,8 @@ class HaLabelBadge extends LitElement {
|
|||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
}
|
}
|
||||||
</style>
|
`,
|
||||||
`;
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
protected updated(changedProperties: PropertyValues): void {
|
protected updated(changedProperties: PropertyValues): void {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user