Skip to content

Commit

Permalink
0.1.4
Browse files Browse the repository at this point in the history
* title fix for Safari browser
* fix for min/max value title spacing
  • Loading branch information
Gluwc committed Mar 25, 2019
1 parent 2250bb1 commit e6db3bd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions bar-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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;
Expand Down Expand Up @@ -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 = ''
Expand Down

0 comments on commit e6db3bd

Please sign in to comment.