kinghat / tabbed-card

a custom card for home assistant that utilizes tabs to segregate individual cards.
MIT License
87 stars 10 forks source link

Icons do not respect "--mdc-tab-text-label-color-default" style #18

Closed davehahn closed 1 year ago

davehahn commented 1 year ago

The icons not respect the "--mdc-theme-primary:" style attribute. Color works for "--mdc-theme-primary" style attribute but not the other. this is the code:

type: custom:tabbed-card
attributes:
  min_width: true
styles:
  '--mdc-theme-primary': yellow
  '--mdc-tab-text-label-color-default': red
tabs:
  - attributes:
      icon: mdi:view-dashboard
    card:
       .....
  - attributes: 
       label: 1
    card:
      ......

This yeilds this with tab 1 (icon) active: Screen Shot 2022-10-14 at 5 08 22 PM

and this with tab 2 active: Screen Shot 2022-10-14 at 5 09 13 PM

Hope this helps. the css for an active tab looks like this

.mdc-tab--active .mdc-tab__icon {
    color: var(--mdc-theme-primary, #6200ee);
}

and the non active tab looks like this

.mdc-tab:not(.mdc-tab--active) .mdc-tab__icon {
    color: var(--mdc-tab-color-default, rgba(0, 0, 0, 0.54));
}

So this may be an issue with mdc-tab, not sure but thought you should know.

davehahn commented 1 year ago

Never mind, after reading the css, i added:

'--mdc-tab-color-default': red

global style attributes, and everything works good.

Cheers.