lovelace-mushroom-themes icon indicating copy to clipboard operation
lovelace-mushroom-themes copied to clipboard

Ability to change font size of Chip text

Open malcolmturnbull opened this issue 3 years ago • 6 comments

I am probably just missing something in Inspector and the stylesheet, but is there currently a term e.g., how there is mush-chip-height, or mush-title-font-size?

I am trying to increase their size so they are easier to use on a touch display. I love these lovelace addons - thank you for all the great work!

malcolmturnbull avatar Feb 12 '22 09:02 malcolmturnbull

This is my current solution, using card_mod styling. This approach is a bit unwieldy because you would need to use templates to change the font size for every chiplet in a Lovelace config. Still hope this is a useful workaround!

  - type: entity
    entity: sensor.weather_station_2_lux
    icon_color: orange
    card_mod:
      style: |
        ::slotted(span) {
          font-size:24px !important;
        }         
        .chip {
          --ha-card-background: teal;
        }

malcolmturnbull avatar Feb 12 '22 10:02 malcolmturnbull

This will be fixed in the next mushroom release : https://github.com/piitaya/lovelace-mushroom/pull/121 The font-size for span, icon and svg will be adjusted automatically.

piitaya avatar Feb 14 '22 21:02 piitaya

Maybe I am missing something, but how do I adjust the font size manually of the chip text?

Kev1000000 avatar Feb 19 '22 15:02 Kev1000000

@Kev1000000 The font-size (and icon size) is automatically adjusted with the chip height. The default chip height is 36px. If you set it to 72px, the font-size will be doubled too.

piitaya avatar Feb 20 '22 17:02 piitaya

@Kev1000000 The font-size (and icon size) is automatically adjusted with the chip height. The default chip height is 36px. If you set it to 72px, the font-size will be doubled too.

How can we set this to 72px?

berkansezer77 avatar May 26 '22 20:05 berkansezer77

You can do this using theme : https://github.com/piitaya/lovelace-mushroom-themes

piitaya avatar May 26 '22 21:05 piitaya

You can do this using theme : https://github.com/piitaya/lovelace-mushroom-themes

I'm having the same issue. How can I override the primary or secondary text font size for a specific card only? I don't want to change this at the global theme level. Any help?

jpoeppelman1 avatar Dec 22 '22 14:12 jpoeppelman1

How can I override the primary or secondary text font size for a specific card only? I don't want to change this at the global theme level. Any help?

any idea?

lyczko avatar Jan 31 '23 11:01 lyczko

It says the theme is not required any more as of 2022.11. If that is the case how would one change the font for an individual card such as a mushroom entity card? I've been playing with this for a few hours and it has me stumped. I can change the background colour like so: - type: custom:mushroom-entity-card entity: sensor.upstairs_atc_temperature fill_container: true card_mod: style: | :host { --ha-card-background: teal; } but have not been successful changing the font size. Help greatly appreciated.

horga83 avatar Feb 24 '23 22:02 horga83

Ah checkout the mushroom theme, there is a list of settings in there, for example under "card" there is:

mush-card-primary-font-size: 14px;

That will set the text in a card. Here is an example:

      - type: custom:mushroom-entity-card
        entity: sensor.downstairs_atc_temperature
        card_mod:
          style: |
            :host {
              --ha-card-background: green;
              --mush-card-primary-font-size: 26px;
            }

horga83 avatar Feb 25 '23 04:02 horga83

I close it as theme variables can be set for one card using card-mod.

piitaya avatar Feb 27 '23 17:02 piitaya