I want to share an experimental responsive grid layout card I’ve built as an alternative to the new grid card. It works like the grid card (minus square support) but its responsive and columns are configurable in your theme instead of as card config. I use grid cards in panel mode to handle layouts and I find that I want to use one responsive 3, 2, 1 columns grid for most main layouts.
Its functionality is best show in a simple video:
It is experimental because of two things that’s not very common:
Configure with theme properties. With no global variables support this were the best idea I had for how to configure a lovelace card globally.
Its built using Svelte, not lit-element. I wanted to try Svelte just for fun and I wanted to show that you can use other frameworks than lit-element to build cards.
Card is not in HACS until I finalise it further. You need to install manually. I want to get feedback on the idea and possible further direction. Grab it here: https://github.com/nervetattoo/themable-grid
There is one caveat as mentioned on GitHub: the child cards get a wrapping div which might or might not be a problem for any custom styling you do with card mod. The column and row styling for the children apply to that wrapper.
1.1 out, marking the real first release in a way. You can now specify arbitrary breakpoints, as many as you like. Card config can also be set on the card as well as on the theme. If you set it on a single card it will not be shared with the rest, kind of defeating my intended purpose, but nice for overriding.
Added PR to get it into HACS as with 1.2 I’m quite happy with where it stands.
It now supports setting specific styles on the cards for specific breakpoints as well as for all breakpoints. Meaning you can now tell a card to span all columns on desktop only. I also renamed the default breakpoints based on intention, so mobile, tablet, desktop.
This now powers my layouts instead of the native grid card. Ideally I’d like to see this functionality in the built-in grid card though. Would love your thoughts on viability of that @baloob
Please integrate or start the steps to integrate into official. There are so many custom components these days that it is getting quite messy… just have a look at the lyric integration about 3 different ways, each in varying stages of neglect, that pretty much do the same thing. This fragmented approach makes it really really really difficult for newbie to get up and running… I am more than happy to help with documentation and testing, bit you wouldn’t want me coding anything…
Yey. Also with a change to how it’s configured. Turns out nested theme props broke the config check … I never realized because reload themes does not run a check and just using that it worked fine. Config now is on the root Lovelace config. Might look into adding support in HA for it in themes because themes should support keys for card specific config imo.
My end goal is also to eventually land on a responsive grid that can be merged into core yes, but experimentation first via a custom card is a good place to start.