Seeking help from layout-card experts =)
I did some searching in this thread but couldnāt find the solution Iām looking for.
Iām about to dig deeper in the css grid options but want to make sure Iām not overengineering thisā¦
Iād like my layout to behave like
ācustom:vertical-layoutā
max_cols: 3
width: 400
but once cards reach the bottom of the screen, automatically move to the next column
and overflow at the bottom of the last column if needed.
I can do this by manually adding custom:layout-break at the bottom of each column but in order to correctly manage screen estate, I want the layout break to happen automatically based on screen size. Examples:
Thanks for the pointer,
I made some progress (below)
I defined the vertical height of the viewport to ensure columns are finite.
everything works and makes sense but the cards flow horizontally so I need to find a way to specify āflex-direction: columnā or something equivalent.
Newbie coder so pretty sure my flex part is in the wrong spot or just plain incorrect so feel free to jump in.
found the equivalent of flex-direction for grid-layout:
āgrid-auto-flowā, thereās a nice writeup here:
but best I could do is below.
Guess Iām stuck with the obvious definition of a āgridā where it ends up aligning all items to same height on each columnā¦ would need each item in each column be directly underneath each other, and not lined upā¦
which seems to bring me back to the āvertical-layout optionāā¦
would just need to figure out a way to apply custom:layout-break based on viewport height.
I had the same annoying 4px margin issues. I have solved it by copying (directory: config/lovelace/www/community/lovelace-layout-card) layout-card.js to layout-card_rs.js.
Then edit layout-card_rs.js with an editor (File editor). Change ā4pxā or ā8pxā in every line with the word āmarginā to ā0pxā.
After that edit the file (directory: config/) and change the line ā- url: /hacsfiles/lovelace-layout-card/layout-card.jsā in ā- url: /hacsfiles/lovelace-layout-card/layout-card_rs.jsā.
Now you got rid of the annoying 4px margins and it wil not be updated anymore.
The two flow cards (Power Flow Now / Energy Flows (today)) are not aligned with the apexcharts-card.
Iām using following grid configuration:
layout:
grid-template-columns: 0em 74px 25% 42% 25% auto
grid-template-rows: grid-title-row-height auto auto
grid-gap: 0.1em
grid-template-areas: |
". . title title title ."
". nav line1 line1 line1 ."
". nav line2 line2 line2 ."
Where the two flow charts are in a horizontal-stack and the 3 gauges and apex are in a vertical-stack WITHIN that horizontal-stack
Can anyone point me in the right direction please ?
I am trying to have a certain card disappear on screens under 800px, but while it resizes the cards and columns, hiding a card actually pushes it off the screen but it still remains visible. See gif for example:
PS: However, if OPās resolution is āuncertainā , then use a larger āminā number(in view-layout grid-area), than Max-width in top layout: mediaquery
Love layout-card, however I face the following challenge:
Iād like to show all lights that are currently on in a certain area, and only show two cards per row on mobile and 5 cards per row on wider screens so, I figured horizontal stack would make sense.
Does anyone know how I can make sure if 1 light is one it shows 50% and if 3 lights are on the first two show on the 1st row and the 3rd on the second row?
Of coutype or paste code hererse on larger screens they can all 3 be displayed on the 1st row.
Try to use min-width on the button-cards, as you have it in a conditional-card, it will always āfillā, as much as it can in row-width ā¦ itās the conditional-card which you have place in āgrid-areaā not the individual button-cards
Evening, not sure if Iām too tired or frustrated.
With this basic layout, grid with a vertical stack in each column, is there a way to remove/reduce the gap between the columns?
I have tried most of the style css I found in this forum, no luck
Itās not a gap in the columns, your center-card is just not āwideā enough to fill itās column
Try to make 4 column 25% each
grid areas:
" left center center right "
Just a wild shot, in the dark night, but you have to āStretchā your ācenterā card
PS: Beside you havenāt Defined any
view_layout:
grid-area:
Should state which card/vertical-stack / in which grid-area ā¦ now they are just thrown in and you might get an undesired āreorderingā when viewing in lower resolution ( Loosing the point with grid-area ! )
Actually you also want the first vertical-stack to āfillā 2 rows ( as you have stacked 2 cards in there, which makes row 1 , 2 cards high ! ā¦ which you eventually will find out/see (Just try to ad another card/vertical-layout , and see where it ends up)