mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 07:16:39 +00:00
Remove styleMap for base-unit (#2428)
This commit is contained in:
parent
2517e5ba60
commit
e9d912cc87
@ -104,10 +104,7 @@ class HuiGaugeCard extends LitElement implements LovelaceCard {
|
||||
|
||||
return html`
|
||||
${this.renderStyle()}
|
||||
<ha-card
|
||||
@click="${this._handleClick}"
|
||||
style="${styleMap({ "--base-unit": this._computeBaseUnit() })}"
|
||||
>
|
||||
<ha-card @click="${this._handleClick}">
|
||||
${
|
||||
error
|
||||
? html`
|
||||
@ -150,6 +147,15 @@ class HuiGaugeCard extends LitElement implements LovelaceCard {
|
||||
return hasConfigOrEntityChanged(this, changedProps);
|
||||
}
|
||||
|
||||
protected firstUpdated(): void {
|
||||
(this.shadowRoot!.querySelector(
|
||||
"ha-card"
|
||||
)! as HTMLElement).style.setProperty(
|
||||
"--base-unit",
|
||||
this._computeBaseUnit()
|
||||
);
|
||||
}
|
||||
|
||||
protected updated(changedProps: PropertyValues): void {
|
||||
super.updated(changedProps);
|
||||
if (!this._config || !this.hass) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user