Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Card_mod inside state_switch doesn't work #103

Open
MikeTheCleric opened this issue Mar 22, 2023 · 4 comments
Open

Card_mod inside state_switch doesn't work #103

MikeTheCleric opened this issue Mar 22, 2023 · 4 comments

Comments

@MikeTheCleric
Copy link

Hi! I'm using state switch to contain a "vertical-stack-in-card" with a bunch of sliders in it.
If I use the card_mod on the sliders it doesn't work at all. If I put the sliders outside the state switch the card_mod works like a charm.
Someone knows why the card_mod doesn't work in this condition? Here's my YAML config of the page. Thanks in advice.

- type: custom:state-switch
  entity: xxxxxxxxxxxxxxxxxxxxxxxxx
  default: default
  states:
     "on":
       type: 'custom:vertical-stack-in-card'
       cards:
         - type: custom:slider-entity-row
           entity: yyyyyyyyyyyyyyyyyyyyy
           full_row: true
           hide_state: true
           card_mod:
             style:
               div.wrapper:
                 ha-slider.full $: |
                   div#sliderContainer.pin {
                     margin-left: 5px !important;
                     margin-right: 10px !important;
                   }
@ildar170975
Copy link

How is that related to state-switch?
Try using card-mod w/o placing your stack inside state-switch and check if it works.

@MikeTheCleric
Copy link
Author

Hi! Thanks for the reply. I tried to place my card outside the state switch and it works with the card_mod.

@ildar170975
Copy link

ildar170975 commented Mar 22, 2023

I tried to place my card outside the state switch and it works with the card_mod.

Could you post a picture with your test card and Code Inspector to check if these margin styles are applied?

OK, nevermind.
It will NOT work.
Even this simple will not work (i.e. style is not added in Code Inspector):

       type: 'custom:vertical-stack-in-card'
       cards:
         - type: custom:slider-entity-row
           entity: input_number.test_number
           card_mod:
             style: |
               div.wrapper {
                 color: red;
               }

One of reasons - because you are using the slider-card NOT inside Entities card (as it supposed to be used).
По-русски - учим матчасть...

@MikeTheCleric
Copy link
Author

Ok, thanks for the help! I'll try using the entities card.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants