Lovelace: Picture Elements Card state-label font scalable?

Is it possible to make the font scalable for a state label? I am trying to make a thermostat control and I used an svg file as the picture so it scales nicely when the browser becomes bigger and smaller. But the text of the state-label does not change so the text is either too big or too small depending on how the svg file scales.

I tried changing the text size by defining it as a percentage but that is just done off the base font size so if I make the font 400% so it is the right size it stays at 400% when I scale the image and it does not scale up or down with the image.

Any help is greatly appreciated!

I don’t think this is possible with the current card. Also, you must be using this with the attribute panel: True under your view? Because typically these cards are not resized.

Yes I am using it with panel: true. I did that because I couldn’t get the card big enough to show the whole background image. Is there a way to specify the background image size so the whole thing will display? If I can make it the correct size for the primary display it will be used on and then I don’t need to worry about scaling. Although it would be pretty cool if I could get it to scale in the future.

Thanks for the help.

You can’t really resize anything. Some cards allow it, some don’t. I don’t believe picture-element does.

Hallo

with font size under style it works fine for me:

      - type: picture-elements
        image: /local/lovelace/back2.jpg
        title: Wohnzimmer
        show_header_toggle: false
        elements:

          - type: state-label
            title: Küche
            icon: mdi:celsius
            tap_action: toggle
            entity: sensor.home_temperature
            style:
              top: 80%
              left: 10%
              font-size: 200%

PNG

2 Likes

Yeah, my comment is referring to the size of the card… not the size of the font. I think I overlooked the word ‘font’ when originally reading this post.

Is there a away to change the font color as well?

You can change pretty much anything at this point when you use the custom card mod