gadgetchnnel / lovelace-header-cards

Header Cards
41 stars 1 forks source link

Odd behaviour when usied in narrow (phone) screen #4

Open sesquipedality opened 2 years ago

sesquipedality commented 2 years ago

I would like the header cards to hide themselves when there is not enough vertical room to show them. Unfortunately instead they shrink the menu tabs so that they are not visible. Is there any way to have a configuration option that gives preference to the view tabs in constrained situations.

FsxShader2012 commented 2 years ago

I would be very interested in this as well.

FsxShader2012 commented 2 years ago

I found a way to circumvent this behaviour. Take a look at the State-Switch and Blank Cards. In this example I used the browser width to determine if header cards should be shown:

header_cards:
  cards:
    - type: custom:state-switch
      entity: mediaquery
      states:
        '(min-width: 1500px)':
          type: markdown
          content: "Test"
        all:
          type: custom:blank-card      #Blank-Card because you need to define a type

You could also use Browser Mod to decide on a device basis.

erkr commented 2 months ago

I found a way to circumvent this behaviour.

Thanks, I used the custom:state-switch with the user entity option. Works great!!!