jcwillox / lovelace-canary

🐤 Adds many useful extensions to lovelace, such as templating secondary info, stacking within a card and more!
MIT License
97 stars 4 forks source link

'no_card: true' don‘t work with 'in_card: true' in vertical-stack #14

Open Krocko opened 3 years ago

Krocko commented 3 years ago

The option no_card: true don‘t work in a vertical-stack card if set in_card: true also.

jcwillox commented 3 years ago

Hmm, I suppose I could include that ability, you could always add no_card: true to the inner cards to hide their backgrounds, and you can probably use canary_style to adjust to card spacing.

type: vertical-stack
cards:
  - type: entities
    title: Lights
    no_card: true
    entities:
      - entity: light.bedroom_light
        secondary_info:
          entity: light.bedroom_underglow
          prefix: 'The Underglow is '
  - type: entities  
    title: Lights
    no_card: true
    canary_style:
      margin-top: -24px;
    entities:
      - light.bedroom_underglow

The reason it doesn't just work implicitly is that the no_card option only works and cards that use the ha-card element, e.g. the entities card, vertical-stack cards do not use ha-card even when using in_card: true.

Krocko commented 3 years ago

Thank you, for your help. I have no_card: true on the inner cards. But this don't work also. Can you please explain how to use this canary_style?

jcwillox commented 3 years ago

Can you provide an example config to demonstrate the issue you're having?

I've updated the example above to include an example of canary_style, there's also some more info in the docs.

canary_style:
  margin-top: -24px;
Krocko commented 3 years ago
  - type: vertical-stack
    in_card: true
    cards:
      - type: markdown
        no_card: true
        content: >-
          ## <center><font color= '#FF8300'>bla bla bla</font></center>
      - type: markdown
        no_card: true
        content: Some Text
      - type: markdown
        no_card: true
        content: Some Value

image


  - type: vertical-stack
    cards:
      - type: markdown
        no_card: true
        content: >-
          ## <center><font color= '#FF8300'>bla bla bla</font></center>
      - type: markdown
        no_card: true
        canary_style:
          margin-top: -24px;
        content: Some Text
      - type: markdown
        no_card: true
        canary_style:
          margin-top: -24px;
        content: Some Value

image

jcwillox commented 3 years ago

Ahhh, I made the mistake of testing on my development version, you're correct canary_style does not work correctly in the currently released version. I'll release a fixed version shortly.

Krocko commented 3 years ago

Thank you very much!

jcwillox commented 3 years ago

This should be fixed in 0.3.2, let me know if it's working now.

Krocko commented 3 years ago

It is still the same problem with 0.3.2

jcwillox commented 3 years ago

Did you make sure you're running the new version, it will show which version you are running in the browser console. In that image you sent, no_card is working, and I can confirm that after copy and pasting the second example you sent canary_style is working correctly in 0.3.2.

Krocko commented 3 years ago

Yes, the latest version is installed.

jcwillox commented 3 years ago

Hmm, well I'm not sure what's happening then, this is what I get. image

Does canary_style not work in any way, e.g. trying to change text color?

canary_style:
  margin-top: '-24px;'
  color: red
Krocko commented 3 years ago

The color: is working but not the margin-top:

  - type: vertical-stack
    cards:
      - type: markdown
        no_card: true
        content: >-
          ## <center><font color= '#FF8300'>bla bla bla</font></center>
      - type: markdown
        no_card: true
        canary_style:
          margin-top: '24px;'
          color: red
        content: Some Text
      - type: markdown
        no_card: true
        canary_style:
          margin-top: '24px;'
          color: red
        content: Some Value

IMG_7088