question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

max_width is ignored

See original GitHub issue

After trying for so long I give up and ask for help.

Somehow, I can’t get max-width working in my config: I get columns with the same width. I’ve copied someone’s config that’s been know to be working (I saw his screens), it is the following:

id: roomsalt
panel: true
path: roomsalt
title: Rooms alt
cards:
  - type: custom:layout-card
    layout: vertical
    column_num: 2
    max_width: [40%, 60%]
    cards:
      - type: entity-button  # Header Card - 40% column
        entity: light.hg_bed
        name: test-label-1
        show_icon: false
        show_label: false
        show_name: true
      - type: horizontal-stack
        cards:
          - type: custom:button-card
            template: header
            label: test-label-1
            entity: light.hg_bed
          - type: custom:button-card
            template: header
            label: test-label-1
            entity: light.hg_bed
      - break
      - type: entity-button # Header Card - 60% column
        entity: light.hg_bed
        name: test-label-2
        show_icon: false
        show_label: false
        show_name: true
      - type: horizontal-stack
        cards:
          - type: custom:button-card
            template: header
            label: test-label-2
            entity: light.hg_bed
          - type: custom:button-card
            template: header
            label: test-label-2
            entity: light.hg_bed
          - type: custom:button-card
            template: header
            entity: light.hg_bed

And somehow, I get 33% for every column width …

I’m running home assistant 0.94.3, I tried getting back to 0.93 but the issue remains.

-> Would anyone have a clue about how to fix this ?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
etrickycommented, Jul 9, 2019

@Gandohr Thank you for showing me that my config was correct. I was able to get it to work by enabling panel mode. From the instructions, it only hints that with panel mode it works better, not that it is mandatory for it to work! I wanted for the columns to be centered and not to fill the whole screen but using this custom card is still much better than trying to guess where lovelace will put the cards!

0reactions
thomaslovencommented, Nov 12, 2019

Should be fixed in latest version. The entire configuration is a bit changed, so using max_width shouldn’t even be necessary.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chrome, Safari ignoring max-width in table - Stack Overflow
The problem is that Chrome and Safari are ignoring "max-width:1000px" My friend has found that we can prevent it by adding "display:block" for...
Read more >
max-width - CSS: Cascading Style Sheets - MDN Web Docs
The max-width CSS property sets the maximum width of an element. It prevents the used value of the width property from becoming larger...
Read more >
maxWidth / minWidth being ignored on animation - GSAP
Hi there - I have set a min and max width on a div, however the code below constantly adds 100px to the...
Read more >
HTML : Table colgroup min-max-width ignored - YouTube
HTML : Table colgroup min- max-width ignored [ Beautify Your Computer : https://www.hows.tech/p/recommended.html ] HTML : Table colgroup ...
Read more >
Grid Column MaxWidth ignored when ColumnSpan is used?
Yes, if you use the "Grid.ColumnSpan="2"", the Grid will ignore the single column width and MaxWidth when execute the Arrange() and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found