text-divider-row icon indicating copy to clipboard operation
text-divider-row copied to clipboard

Text has a black background since 1.4.1 (when lovelace card is transparent)

Open Waylikemark opened this issue 3 years ago • 17 comments

Checklist:

  • [x] I updated to the latest version available
  • [x] I cleared the cache of my browser

Release with the issue: 1.4.1

Last working release (if known): 1.4.0

Browser and Operating System: iOS compagnon app 2021.11.1 & Safari on iOS 15.2

Description of problem: When using text divider row 1.4.1 WITH the ios dark mode theme the text gets a black background, the same as subtitles have. Tried different theme’s like ios themes - dark mode and light mode, UX Goodie Theme an Transparent blue and all got the same result. It looks like when a lovelace card is set to transparent the text gets the background. 341947F3-FC7A-45C4-B8FD-8FAF80903EAB

Javascript errors shown in the web inspector (if applicable):


Additional information:

Waylikemark avatar Dec 18 '21 10:12 Waylikemark

I experience the same problem.

Gaute2000 avatar Dec 20 '21 23:12 Gaute2000

Same here

tbrausch avatar Dec 21 '21 11:12 tbrausch

Same here

jeremybreeschoten avatar Dec 22 '21 13:12 jeremybreeschoten

Same issue here

JeroenDeckers avatar Dec 22 '21 15:12 JeroenDeckers

Also here

philder avatar Dec 23 '21 02:12 philder

same issue works fine on 1.4.0

chinyaolin avatar Dec 27 '21 09:12 chinyaolin

Same here.

Improvement suggestion to work with :before & :after instead of raised border: https://github.com/iantrich/text-divider-row/issues/23

titiviking avatar Dec 30 '21 13:12 titiviking

Yep, same issue here.

Is a fix coming? Or is there a setting I need to add to restore it to the original function?

floodwayprintco avatar Jan 19 '22 17:01 floodwayprintco

Any news on this issue?

dbloom86 avatar Apr 28 '22 12:04 dbloom86

Same issue here

I fix it with this hacs : https://github.com/thomasloven/lovelace-card-mod

style: |
  h2:before, h2:after {
    position: absolute;
    top: 51%;
    overflow: hidden;
    width: 50%;
    height: var(--line-size);
    content: '\a0';
    background-color: var(--divider-color);
  }

  h2:before {
    margin-left: -50%;
    text-align: right;
  }
  h2.text-divider {
    border-bottom: none;
  }

  h2.text-divider span {
    background: none;
  }

image

image

paulo1er avatar May 17 '22 08:05 paulo1er

@paulo1er unfortunately this doesn't work for me. Maybe because I have it inside an entities card? This is my card config:

`entities:

  • type: custom:text-divider-row text: Afvalwijzer

  • card_type: markdown content: > <ha-icon icon= {{'mdi:delete-alert' if states('sensor.circulus_afval_vandaag') != 'Geen' else 'mdi:delete-outline'}}> Vandaag, {{states('sensor.simple_date')}}: <font color = {% if states('sensor.circulus_afval_vandaag') == 'pmd' %}'#ff944d' {% elif states('sensor.circulus_afval_vandaag') == 'gft' %}'#00e64d' {% elif states('sensor.circulus_afval_vandaag') == 'papier' %}'#3399ff' {% else %}'grey' {% endif %}> {{states('sensor.circulus_afval_vandaag')}}

    <ha-icon icon= {{'mdi:delete-alert' if states('sensor.circulus_afval_morgen') != 'Geen' else 'mdi:delete-outline'}}> Morgen, {{states('sensor.simple_tomorrow')}}: <font color = {% if states('sensor.circulus_afval_morgen') == 'pmd' %}'#ff944d' {% elif states('sensor.circulus_afval_morgen') == 'gft' %}'#00e64d' {% elif states('sensor.circulus_afval_morgen') == 'papier' %}'#3399ff' {% else %}'grey' {% endif %}> {{states('sensor.circulus_afval_morgen')}}
    style: | h2:before, h2:after { position: absolute; top: 51%; overflow: hidden; width: 50%; height: var(--line-size); content: '\a0'; background-color: var(--divider-color); }

    h2:before { margin-left: -50%; text-align: right; } h2.text-divider { border-bottom: none; }

    h2.text-divider span { background: none; } ha-card { box-shadow: none; border-radius: 10px; background: none; } type: custom:hui-element

  • type: divider

  • card: null card_type: glance entities:

    • entity: sensor.circulus_afval_gft name: GFT
    • entity: sensor.circulus_afval_papier name: Papier
    • entity: sensor.circulus_afval_pmd name: PMD style: | ha-card { box-shadow: none; border-radius: 10px; background: none; } type: custom:hui-element style: .: | #states > * { margin: 2px 0px !important; } ha-card { border: solid 2px var(--primary-color); background-color: var(--ha-card-background); } type: entities `

And it shows like this: image

dbloom86 avatar May 17 '22 08:05 dbloom86

@dbloom86 I think you put the syle not in the right place

try something like this :

type: entities
entities:
  - type: custom:text-divider-row
    text: Afvalwijzer
    style: |
      h2:before, h2:after {
          position: absolute;
          top: 51%;
          overflow: hidden;
          width: 50%;
          height: var(--line-size);
          content: '\a0';
          background-color: var(--divider-color);
      }
      h2:before {
          margin-left: -50%;
          text-align: right;
      }
      h2.text-divider {
          border-bottom: none;
      }
      h2.text-divider span {
          background: none;
      }
      ha-card {
          box-shadow: none;
          border-radius: 10px;
          background: none;
      }
  - card_type: markdown
    content: >
      <ha-icon icon= {{'mdi:delete-alert' if
      states('sensor.circulus_afval_vandaag') != 'Geen' else
      'mdi:delete-outline'}}> Vandaag, {{states('sensor.simple_date')}}: <font
      color = {% if states('sensor.circulus_afval_vandaag') == 'pmd' %}'#ff944d'
      {% elif states('sensor.circulus_afval_vandaag') == 'gft' %}'#00e64d' {%
      elif states('sensor.circulus_afval_vandaag') == 'papier' %}'#3399ff' {%
      else %}'grey' {% endif %}> {{states('sensor.circulus_afval_vandaag')}}

      <ha-icon icon= {{'mdi:delete-alert' if
      states('sensor.circulus_afval_morgen') != 'Geen' else
      'mdi:delete-outline'}}> Morgen, {{states('sensor.simple_tomorrow')}}:
      <font color = {% if states('sensor.circulus_afval_morgen') == 'pmd'
      %}'#ff944d' {% elif states('sensor.circulus_afval_morgen') == 'gft'
      %}'#00e64d' {% elif states('sensor.circulus_afval_morgen') == 'papier'
      %}'#3399ff' {% else %}'grey' {% endif %}>
      {{states('sensor.circulus_afval_morgen')}}
    type: custom:hui-element
  - type: divider
   ...

PS : if you want to post code block you can use ``` quoting-code :)

paulo1er avatar May 17 '22 09:05 paulo1er

@paulo1er You are absolutely right! Thanks a million! It works like a charm! Sorry about the code block, I thought I used quotes, but I used the single ones xD

dbloom86 avatar May 17 '22 09:05 dbloom86

I have the same problem. Would be happy for a fix!

mxwi avatar Jun 21 '22 13:06 mxwi

Folks, does it still work you? The code you posted does not influence ha-card. I am trying to edit the .js and hardcode my background color that also does not work for me as there are still some inherited properties.

I would buy a coffee to the author s/he should correct this bug...

vahaldor avatar Aug 01 '22 13:08 vahaldor

I have the same problem. A rollback to version 1.4.0 works better for me because the background is transparent again, but so I miss the alignment options of version 1.4.1. :-(((

Is there no one who can fix this little thing? That would be great and would not only help me a lot.

dl-84 avatar Dec 10 '22 14:12 dl-84

Not sure why card_mod does not work on 1.4.1 but I'm having the same issue...

filikun avatar Jan 25 '23 10:01 filikun