custom-cards / bignumber-card

Apache License 2.0
121 stars 23 forks source link

Font Size #39

Open hartitman opened 1 year ago

hartitman commented 1 year ago

Hi,

Can font sizes for both name/title and state/unit code be added so these can be changed.

Thank you

igorsantos07 commented 8 months ago

Yep, that gets a bit complicated when you try to make different layouts with different bar sizes and text goes awry...

Either too small image

Or going over the scale size (40px in this example) image

DeFlanko commented 3 months ago

image Adding to this post, seemed relevant.

Using System bridge to capture my Host CPU core data, then using big number card to display the core cpu data to match that layout you'd normally see in Task Manager gets me this view.

It works, but Im looking for a way to keep the same sized box scale, but literally shrink the font size by 50% I have tried:

type: custom:bignumber-card
min: 0
max: 100
entity: sensor.load_cpu_0
color: cornflowerblue
from: bottom
scale: 30px
card_mod:
  style: |
    ha-card {
      font-size: 10px;
    }

_But card-mod only works on cards that contain a ha-card element. This includes almost every card which can be seen, but not e.g. conditional, entityfilter, vertical-stack, horizontal-stack, grid.

which these cards are in a vertical can horizonal stacks to produce the layout.

Tamooj commented 1 week ago

I'll second the question - the fonts don't scale down when the box is scaled down, and regularly spills outside. This is a common problem for smaller tablet-based dashboards, etc. I almost want to call this a bug.