AitorDB / home-assistant-sun-card

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

Fix styles #19

Open AitorDB opened 3 years ago

AitorDB commented 3 years ago

Fix styles to use Home assistant theme where possible and improve how it looks in general. More context: https://www.reddit.com/r/homeassistant/comments/ne2mx4/sun_card_for_home_assistant/gyelt6z

kongo09 commented 3 years ago

I've used the following styles to make the look fit better with the overall HA theme and the custom:weather-card which sits right next to it:

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;
    }

results in (including the weather-card):

image

I also disabled the footer and removed the padding of the graph similar to what the mini-graph-card is doing.

techathome21 commented 3 years ago

I've used the following styles to make the look fit better with the overall HA theme and the custom:weather-card which sits right next to it:

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;
    }

results in (including the weather-card):

image

I also disabled the footer and removed the padding of the graph similar to what the mini-graph-card is doing.

Hi, can you please tell me how do you remove the footer of the sun card?

kongo09 commented 3 years ago

how do you remove the footer

Apologies, I must have made a copy-paste error. Here is the complete configuration including footer removal:

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;
    }
techathome21 commented 3 years ago

how do you remove the footer

Apologies, I must have made a copy-paste error. Here is the complete configuration including footer removal:

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;
    }

Thank you very much, that's exactly what i wanted. regards