From 71d759a8a1ce79be07d816c109bff73aba34c5a0 Mon Sep 17 00:00:00 2001 From: Nik Rolls Date: Fri, 2 Aug 2019 13:49:04 +1200 Subject: [PATCH] Fix #55: toggle switch disappearing The icon seems to shrink to the available space (could be from the `ha-icon` component itself). Reserving the space for it prevents this. --- src/main.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.js b/src/main.js index e784284..17be024 100644 --- a/src/main.js +++ b/src/main.js @@ -125,15 +125,17 @@ class FoldEntityRow extends LitElement { static get styles() { return css` #head { + --toggle-icon-width: 40px; display: flex; cursor: pointer; align-items: center; } #head entity-row-maker { flex-grow: 1; + max-width: calc(100% - var(--toggle-icon-width)); } #head ha-icon { - width: 40px; + width: var(--toggle-icon-width); cursor: pointer }