Clooos / Bubble-Card

Bubble Card is a minimalist card collection for Home Assistant with a nice pop-up touch.
MIT License
1.97k stars 57 forks source link

Setting colors in theme? #519

Open mrgrlscz opened 6 months ago

mrgrlscz commented 6 months ago

Is bubble-button-background-color the only color we can set at theme level?? Every other color seems to be hard-coded. This causes different problems:

Maybe (I'm absolutely NOT a developer) something like : icon_color.is_active = var(--bubble-button-icon-color-active) if set else rgb(255,220,200)

For:

This is what I do for now, here's part of my code and only works for bubble-button in switch mode, not sliders.

styles: |
  /* ####################### COMMON 1/3 ####################### */
  /* main_card */
  ha-card {
    --bubble-button-background-color: transparent !important;
  }
  ha-card > div > div {
    border-radius: var(--ha-card-border-radius) !important; 
  }
  ha-card > div > div > div {
    background-color: transparent !important;
  }

  /* text */
  div.bubble-name-container.name-container {
    color: var(--secondary-text-color);
  }
  .is-unavailable div.bubble-name-container.name-container {
    color: var(--warning-color);
  }
  .is-on div.bubble-name-container.name-container {
    color: var(--contrast);
  }

  /* sub_button */
  .bubble-sub-button-container > div {
    color: var(--primary-text-color) !important;  
    background-color: var(--surface0) !important;
    opacity: var(--alpha);
  }

  /* slider_radius */
  .range-fill {
    border-radius: 4px;
  }

  /* ####################### SPE SWITCH LIGHTS ####################### */

  /* icon_color */
  .bubble-icon-container.icon-container > ha-icon {
    transition: color 2s;
    color: ${state == 'on' ? 'var(--contrast)' : '' } !important;
  }

  /* icon_background */
  .bubble-icon-container.icon-container::after {
    transition: background 2s;
    background-color: var(--aqua);
  }

  /* button_background */
  .bubble-button-background {
    transition: background 2s;
    background-color: ${state == 'on' ? 'var(--aqua)' : '' } !important;
  }

Resulting in: (stock to the left, with the code above to the right) image

And this pic is from another theme... image

I know you're already busy, and I'm a patient guy ;) By the way you did great job, and even if I'll not use it for me (custom-layout) I think your recent 'section view' compatibility will push bubble-card over boundaries!!

koleos6 commented 6 months ago

Yes , could be a nice évolution for easier adoption to allow the parameters of the theme in a bubble-card

gbcatrinoiu commented 6 months ago

+1

Clooos commented 5 months ago

This is in my mind for a long time, but I've added so many new features in the v2 that I had to stop somewhere.

But I will definitely add that possibility in the future.

mrgrlscz commented 5 months ago

Patience is the mother of all virtues!! Again, congrats for your work.

lforamitti commented 5 months ago

I would like to get the same background for the bubble-card and all others cards, but the bubble-card show a black background and the other card use the default background-color.

image

ausfas commented 1 month ago

This is exactly I have been looking for and have been spending the entire week. While Clooos has made the best card in HA I do not want to apply card level changes. Hope Clooos would get time to allow changes to switch, slider, lights background independently via theme under card-mod