From e6db3bd433a4e6a6b348002c49642ec1531628d7 Mon Sep 17 00:00:00 2001 From: Gluwc Date: Mon, 25 Mar 2019 19:27:37 +0100 Subject: [PATCH] 0.1.4 * title fix for Safari browser * fix for min/max value title spacing --- bar-card.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bar-card.js b/bar-card.js index f580044..d371ce7 100644 --- a/bar-card.js +++ b/bar-card.js @@ -312,7 +312,6 @@ class BarCard extends HTMLElement { if (config.title_position == 'inside') { positionTitleStyle = ` width: calc(100% - 8px); - z-index: 2; font-weight: bold; color: #FFF; text-shadow: 1px 1px #000; @@ -464,6 +463,7 @@ class BarCard extends HTMLElement { mix-blend-mode: color; } #icon_${id} { + position: relative; --padding-left: 2px; --padding-right: 2px; padding-left: var(--padding-left); @@ -476,12 +476,13 @@ class BarCard extends HTMLElement { ${iconStyle} } #title_${id} { + position: relative; ${positionTitleStyle} ${titleStyle}; text-align: ${textAlign}; } #value_${id} { - z-index: 1; + position: relative; padding-bottom: ${paddingStyle}; --padding-right: 4px; --padding-left: 4px; @@ -776,10 +777,10 @@ class BarCard extends HTMLElement { root.getElementById('indicatorColor_'+id).textContent = '▼' break case 'off': - if (config.title_position !== 'inside' && config.title_position !== 'off') titleElement.style.removeProperty('--padding-left') + if (config.title_position == 'inside') titleElement.style.removeProperty('--padding-left') valueElement.style.removeProperty('--padding-left') if (config.show_icon == true) iconElement.style.removeProperty('--padding-left') - if (config.title_position !== 'inside' && config.title_position !== 'off') titleElement.style.removeProperty('--padding-right') + if (config.title_position == 'inside') titleElement.style.removeProperty('--padding-right') valueElement.style.removeProperty('--padding-right') if (config.show_icon == true) iconElement.style.removeProperty('--padding-right') root.getElementById('indicator_'+id).textContent = ''