From a763ad5bf1482a293327bba004749a2e2989f160 Mon Sep 17 00:00:00 2001 From: Denis Shulyaka Date: Thu, 18 Jun 2020 16:50:49 +0300 Subject: [PATCH] reapply suggestions from code review --- src/components/entity/ha-entity-humidifier.ts | 51 ++++++++++--------- src/components/entity/ha-entity-toggle.ts | 39 +++++++------- 2 files changed, 48 insertions(+), 42 deletions(-) diff --git a/src/components/entity/ha-entity-humidifier.ts b/src/components/entity/ha-entity-humidifier.ts index ac6603e499..480188c54b 100644 --- a/src/components/entity/ha-entity-humidifier.ts +++ b/src/components/entity/ha-entity-humidifier.ts @@ -27,35 +27,36 @@ class HaEntityHumidifier extends HaEntityToggle { `; } - static get styles(): CSSResult { - return css` - :host { - display: flex; - flex-direction: row; - justify-content: center; - align-items: center; - } + static get styles(): CSSResult[] { + return [ + super.styles, + css` + :host { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + } - .target { - color: var(--primary-text-color); - } + .target { + color: var(--primary-text-color); + } - .current { - color: var(--secondary-text-color); - } + .current { + color: var(--secondary-text-color); + } - .state-label { - font-weight: bold; - text-transform: capitalize; - } + .state-label { + font-weight: bold; + text-transform: capitalize; + } - .unit { - display: inline-block; - direction: ltr; - } - - ${super.styles} - `; + .unit { + display: inline-block; + direction: ltr; + } + `, + ]; } } diff --git a/src/components/entity/ha-entity-toggle.ts b/src/components/entity/ha-entity-toggle.ts index 587f299641..1756ccb929 100644 --- a/src/components/entity/ha-entity-toggle.ts +++ b/src/components/entity/ha-entity-toggle.ts @@ -138,23 +138,28 @@ export class HaEntityToggle extends LitElement { }, 2000); } - static get styles(): CSSResult { - return css` - :host { - white-space: nowrap; - min-width: 38px; - } - ha-icon-button { - color: var(--ha-icon-button-inactive-color, var(--primary-text-color)); - transition: color 0.5s; - } - ha-icon-button[state-active] { - color: var(--ha-icon-button-active-color, var(--primary-color)); - } - ha-switch { - padding: 13px 5px; - } - `; + static get styles(): CSSResult[] { + return [ + css` + :host { + white-space: nowrap; + min-width: 38px; + } + ha-icon-button { + color: var( + --ha-icon-button-inactive-color, + var(--primary-text-color) + ); + transition: color 0.5s; + } + ha-icon-button[state-active] { + color: var(--ha-icon-button-active-color, var(--primary-color)); + } + ha-switch { + padding: 13px 5px; + } + `, + ]; } }