artem-sedykh / mini-climate-card

Minimalistic climate card for Home Assistant Lovelace UI
MIT License
262 stars 19 forks source link

How do I change the state color in the indicators ? #120

Closed DaN66O closed 1 year ago

DaN66O commented 1 year ago

Can I use styles or mapper to change the color of the value in the indicators or hide state ?

Screenshot_18

Actually I wanted to show only the icon without showing the value. I thought it could be done using .state__value { color: 'transparent !important' } or .state__value {display: none;}

I have changed the icon and its color, but I do not know how to make the value invisible.

    indicators:
      t_sensor:
        icon:
          template: >
            (value) => (value == 'Ext' ? 'mdi:alpha-e-circle-outline' : 'mdi:alpha-i-circle-outline')
          style: > 
            (value) => (value == 'Ext' ? { color:'#4bc241'} : {color:'#b74a9b'} )
regevbr commented 1 year ago

This is currently not supported. A PR is more than welcome!

About

 .state__value { color: 'transparent !important' }

This should work but I'm not sure how you can apply custom CSS to an isolated component

DaN66O commented 1 year ago

.state__value { color: 'transparent !important' } and .state__value {display: none;} It doesn't work It would be ideal if it was possible to hide the value leaving only the icon in the indicators. Can we hope that this will be done in the next versions ?

regevbr commented 1 year ago

If you create a PR, then yes I will release it as soon as possible after a code review

DaN66O commented 1 year ago

I can't create a PR. Tell me how ?

regevbr commented 1 year ago

https://docs.github.com/en/get-started/quickstart/contributing-to-projects

DaN66O commented 1 year ago

I read the link above I realized that I myself have to make changes to the project and post them. But I do not know how to make these changes...

regevbr commented 1 year ago

released in 2.6.0

regevbr commented 1 year ago

you can use indicator:name:value:style, same as you do for icon