AitorDB / home-assistant-sun-card

Home assistant sun card based on Google weather design
MIT License
407 stars 184 forks source link

Allow to hide each text element #22

Open AitorDB opened 3 years ago

AitorDB commented 3 years ago

Keeping the current visibility as default, we could allow each text element to be hidden.

Context: https://www.reddit.com/r/homeassistant/comments/ne2mx4/sun_card_for_home_assistant/gyeip4x Context: https://www.reddit.com/r/homeassistant/comments/ne2mx4/sun_card_for_home_assistant/gyepgsc

kongo09 commented 3 years ago

Trying this out with card_mod gives an even simpler and cleaner result. Looking forward to this. image

sylviepipi commented 3 years ago

Hide all text and add a clock. Then my panels looks to same as my iwatch

MartinHenriksson commented 2 years ago

How was this acheived with card_mod? I can't seem to get it to apply.

kongo09 commented 2 years ago

Try this:

type: custom:sun-card
language: de
card_mod:
  style: |
    div.sun-card {
      padding: 1.3em 0;
    }
    div.sun-card-header {
      padding: 0 2em;
    }
    .sun-card-text-subtitle {
      font-size: inherit !important;
      font-weight: 300 !important;
    }
    .sun-card-text-time {
      font-weight: bold !important;
    }
    div.sun-card-text-container {
      align-items: inherit;
    }
    div.sun-card-text-container:nth-child(1) {
      text-align: left;
    }
    div.sun-card-text-container:nth-child(2) {
      text-align: right;
    }
    div.sun-card-footer {
      display: none;
    }
MartinHenriksson commented 2 years ago

Thanks for the reply kongo, I did also reach out in the discord for Home Assistant and there was someone whom assisted me there to come to this result:

card_mod:
  style: |
    .sun-card-header span {
     font-size: var(--mdc-typography-body1-font-size) !important;
     padding-bottom: 0px !important;
    }
    .sun-card-text-subtitle {
      color: var(--secondary-text-color) !important;
    }
    .sun-card-footer span {
      font-size: var(--mdc-typography-body1-font-size) !important;
    }
    .sun-card-footer-row {
      padding-top: 0px !important
    }

Again, thanks for taking the time!