Revert to 372ecc6

This commit is contained in:
Denis Shulyaka 2020-06-20 22:25:21 +03:00
parent b242c6651a
commit 2cc9d70915
2 changed files with 42 additions and 51 deletions

View File

@ -27,39 +27,35 @@ class HaEntityHumidifier extends HaEntityToggle {
`; `;
} }
static get styles(): CSSResult[] { static get styles(): CSSResult {
const toggle_styles = super.styles; return css`
const humidifier_styles = [ :host {
css` display: flex;
:host { flex-direction: row;
display: flex; justify-content: center;
flex-direction: row; align-items: center;
justify-content: center; }
align-items: center;
}
.target { .target {
color: var(--primary-text-color); color: var(--primary-text-color);
} }
.current { .current {
color: var(--secondary-text-color); color: var(--secondary-text-color);
} }
.state-label { .state-label {
font-weight: bold; font-weight: bold;
text-transform: capitalize; text-transform: capitalize;
} }
.unit { .unit {
display: inline-block; display: inline-block;
direction: ltr; direction: ltr;
} }
`,
]; ${super.styles}
return toggle_styles `;
? toggle_styles.concat(humidifier_styles)
: humidifier_styles;
} }
} }

View File

@ -138,28 +138,23 @@ export class HaEntityToggle extends LitElement {
}, 2000); }, 2000);
} }
static get styles(): CSSResult[] { static get styles(): CSSResult {
return [ return css`
css` :host {
:host { white-space: nowrap;
white-space: nowrap; min-width: 38px;
min-width: 38px; }
} ha-icon-button {
ha-icon-button { color: var(--ha-icon-button-inactive-color, var(--primary-text-color));
color: var( transition: color 0.5s;
--ha-icon-button-inactive-color, }
var(--primary-text-color) ha-icon-button[state-active] {
); color: var(--ha-icon-button-active-color, var(--primary-color));
transition: color 0.5s; }
} ha-switch {
ha-icon-button[state-active] { padding: 13px 5px;
color: var(--ha-icon-button-active-color, var(--primary-color)); }
} `;
ha-switch {
padding: 13px 5px;
}
`,
];
} }
} }