-
Notifications
You must be signed in to change notification settings - Fork 67
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
Add layout option #98
Conversation
My initial approach was to just add the wrapper without adding an option to this card itself, so that the column styling could be done with card-mod, but it started to feel a bit kludgey, particularly when I ran into the margin issue. Progress on that is here: https://github.com/hjbotha/lovelace-multiple-entity-row/tree/add-entities-wrapper-div If you prefer that approach, let me know and I'll polish up that branch and submit a new PR. |
Hmm, interesting suggestion. Do you have a screenshot of how this looks? Does it not take up a lot of vertical space? I do not see a problem with adding this to the card as long as the row-version still behaves the same :) I'll try to merge it in when I get the time to bump a new version. |
Here you go: Code for (the first 2 rows of) that card:
It definitely gets a bit crowded with more than 2, but I think it works if you colour alternating rows and/or have secondary-info. I did this for compactness on a smallish tablet dashboard. More work would be needed to make labels make sense. They should probably be shown to the left of the states if someone wanted them shown at all in this layout. I'm actually running the other branch at the moment and it works great, so if you don't want to make this a feature of the card just having the entities wrapped would allow for a fair bit of customisation without you having to test a whole bunch of new layouts. |
Merged your changes, with a few adjustments. Kept the old margins because the And thanks for your contribution :) |
Pure elegance. I love it. Thank you! |
This PR adds a "column" boolean config option to the entity row definition. When enabled, entities in that row will be shown in a column rather than a row.
To enable this I had to make a few supporting changes:
entity:last-of-type { margin-right: 0; }
is not a viable solution when things may be arranged in a column.I tested a couple of different cards with different settings and these changes didn't affect the layout of those at all, but given the flexibility of this card there may well be some combinations that will be affected.
Also, the "gap" property is super new, so bear that in mind.