Skip to content

Commit 60e0707

Browse files
authored
Refactor ha-config-labels to use styleMap (#27248)
1 parent c998086 commit 60e0707

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/panels/config/labels/ha-config-labels.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import type { PropertyValues } from "lit";
1010
import { LitElement, html, nothing } from "lit";
1111
import { customElement, property, state } from "lit/decorators";
1212
import memoizeOne from "memoize-one";
13+
import { styleMap } from "lit/directives/style-map";
1314
import { computeCssColor } from "../../../common/color/compute-color";
1415
import { formatShortDateTime } from "../../../common/datetime/format_date_time";
1516
import { storage } from "../../../common/decorators/storage";
@@ -104,13 +105,14 @@ export class HaConfigLabels extends LitElement {
104105
template: (label) =>
105106
label.color
106107
? html`<div
107-
style="
108-
background-color: ${computeCssColor(label.color)};
109-
border-radius: 10px;
110-
border: 1px solid var(--outline-color);
111-
box-sizing: border-box;
112-
width: 20px;
113-
height: 20px;"
108+
style=${styleMap({
109+
backgroundColor: computeCssColor(label.color),
110+
borderRadius: "10px",
111+
border: "1px solid var(--outline-color)",
112+
boxSizing: "border-box",
113+
width: "20px",
114+
height: "20px",
115+
})}
114116
></div>`
115117
: nothing,
116118
},

0 commit comments

Comments
 (0)