wassy92x / lovelace-digital-clock

A custom digital clock card for Home Assistant
MIT License
96 stars 17 forks source link

Feature Request: Font Sizing. #11

Closed MikeGuest closed 2 years ago

MikeGuest commented 2 years ago

Hi.

I love this add-on - my only issue is, i'm using it as the last button on my menu line, and the size of the fonts causes the tile to be truncated on my tablets. (example below)

I'd love an easy way to specify the date and time font sizes (separately if possible) in the yaml.

image

Thanks

wassy92x commented 2 years ago

If you like to change the font size please use card-mod. https://github.com/thomasloven/lovelace-card-mod

If you need some help, you can respond to this issue.

MikeGuest commented 2 years ago

is it possible to use card-mod to change the text size of each line independently?

Thanks

LUBANG37 commented 2 years ago

My configuration:

GRID

type: custom:digital-clock dateFormat: ' ' card_mod: style: | .type-custom-digital-clock { font-size: 40px !important; font-weight: bold !important; color: orange; }

type: custom:digital-clock timeFormat: ' ' dateFormat: weekday: long day: 2-digit month: short card_mod: style: | .type-custom-digital-clock { font-size: 15px !important; font-weight: normal !important; color: orange; } window

smartroad commented 2 years ago

Just in case anyone else finds this like I did to figure out how to change font size, you can change the each line without having to have two cards:

type: custom:digital-clock
dateFormat:
  weekday: long
  day: 2-digit
  month: short
  year: numeric
timeFormat:
  hour: 2-digit
  minute: 2-digit
  second: 2-digit
card_mod:
  style: |
    .first-line {
      font-size: 56px !important;}
    .second-line {
      font-size: 8px !important;}

image

MikeGuest commented 2 years ago

card_mod: style: | .first-line { font-size: 56px !important;} .second-line { font-size: 8px !important;}

Works for me. Many thanks.

I think it might benefit others if this could be an addition to the docs rather than someone having to ferret out this old request though.