diff --git a/src/components/battery.ts b/src/components/battery.ts index 2834094..c35944f 100644 --- a/src/components/battery.ts +++ b/src/components/battery.ts @@ -58,11 +58,6 @@ export const batteryElement = ( : null} void }) => { main.openDetails(e, entities.battery?.state_of_charge!); }} diff --git a/src/components/individualLeftBottomElement.ts b/src/components/individualLeftBottomElement.ts index 380509f..b79682b 100644 --- a/src/components/individualLeftBottomElement.ts +++ b/src/components/individualLeftBottomElement.ts @@ -66,11 +66,6 @@ export const individualLeftBottomElement = ( (individualObj.displayZeroTolerance ?? 0) - ? "padding-bottom: 2px;" - : "padding-bottom: 0px;"}" > ${individualObj?.field?.display_zero_state !== false || (individualObj?.state || 0) > (individualObj.displayZeroTolerance ?? 0) ? html` ${individualSecondarySpan(main.hass, main, templatesObj, individualObj, 0, "left-top")} - (individualObj.displayZeroTolerance ?? 0) - ? "padding-bottom: 2px;" - : "padding-bottom: 0px;"}" - > + ${individualObj?.field?.display_zero_state !== false || (individualObj.state || 0) > (individualObj.displayZeroTolerance ?? 0) ? html` ${individualObj?.showDirection diff --git a/src/components/individualRightBottomElement.ts b/src/components/individualRightBottomElement.ts index 3b58d9f..6b01f5e 100644 --- a/src/components/individualRightBottomElement.ts +++ b/src/components/individualRightBottomElement.ts @@ -46,14 +46,7 @@ export const individualRightBottomElement = ( }} > ${individualSecondarySpan(main.hass, main, templatesObj, individualObj, 3, "right-bottom")} - (individualObj.displayZeroTolerance ?? 0) - ? "padding-bottom: 2px;" - : "padding-bottom: 0px;"}" - > + ${individualObj?.field?.display_zero_state !== false || (individualObj.state || 0) > (individualObj.displayZeroTolerance ?? 0) ? html` ${individualObj?.showDirection diff --git a/src/components/individualRightTopElement.ts b/src/components/individualRightTopElement.ts index 365cba3..90d4dcc 100644 --- a/src/components/individualRightTopElement.ts +++ b/src/components/individualRightTopElement.ts @@ -50,10 +50,7 @@ export const individualRightTopElement = ( (individualObj.displayZeroTolerance ?? 0) - ? "padding-bottom: 2px;" - : "padding-bottom: 0px;"}" + > ${individualObj?.field?.display_zero_state !== false || (individualObj.state || 0) > (individualObj.displayZeroTolerance ?? 0) ? html` diff --git a/src/components/nonFossil.ts b/src/components/nonFossil.ts index f907f9e..89dfc53 100644 --- a/src/components/nonFossil.ts +++ b/src/components/nonFossil.ts @@ -38,15 +38,7 @@ export const nonFossilElement = ( }} > ${generalSecondarySpan(main.hass, main, templatesObj, nonFossil, "low-carbon")} - (entities.fossil_fuel_percentage?.display_zero_tolerance || 0) - ? "padding-bottom: 2px;" - : "padding-bottom: 0px;"}" - > + ${entities.fossil_fuel_percentage?.display_zero_state !== false || (nonFossil.state.power || 0) > (entities.fossil_fuel_percentage?.display_zero_tolerance || 0) ? html` diff --git a/src/components/solar.ts b/src/components/solar.ts index 9283cef..0303d45 100644 --- a/src/components/solar.ts +++ b/src/components/solar.ts @@ -31,12 +31,7 @@ export const solarElement = ( }} > ${generalSecondarySpan(main.hass, main, templatesObj, solar, "solar")} - 0 ? "padding-bottom: 2px;" : "padding-bottom: 0px;"}" - > + ${entities.solar?.display_zero_state !== false || (solar.state.total || 0) > 0 ? html` ${displayValue(main.hass, solar.state.total as number)}` : ""} diff --git a/src/style.ts b/src/style.ts index 2d4993d..4610bc1 100644 --- a/src/style.ts +++ b/src/style.ts @@ -88,6 +88,7 @@ export const styles = css` position: relative; text-decoration: none; color: var(--primary-text-color); + gap: 2px; // background-color: var(--card-background-color); /* hide overflowing lines behind background */ }