Would like to ask styling options of tile card, I plan to overlay some to floor plan picture element card, and the space is tight on small screens. So I’d like to ask if there is a way to only show icon (like state-icon) when screen width is below 600px?
For bigger screen I have space to display the tile car without issue, it’s mainly a problem on iPhone. I prefer tile card to state-icon as it can present more info. Many thanks in advance!
Ok answer to my own question, yes it’s possible and I even managed to reduce the gaps between the tiles (so in 203px height I can squeeze in 5 tiles). However it’s not without problem:
when I click the icon the clickable area is de-centred, I think it’s because I forced 30px height but internally tile icons assume some padding around and hence all tiles are now having offset and click area is not the same as display area, anybody knows a way to fix it?
There is a lot repeating code, for each tile the styling is the same - is there a better way to reuse the styling?
Thanks in advance!
This is probably a bit more work to setup, but it uses only “stock” capabilities. If you look at the visibility section for tiles (or maybe it would be better as a section), you can add a condition for SCREEN. So you could do a section for mobile with one layout and a section for other things. The screen visibility option doesn’t give you granular control for the pixel, but it might be close enough.
Could be the ripple which is defined in ::before pseudo class I believe
Use card_mod class configuration and then style your class in a card_mod theme.
I note that v4 beta now can style stacks, so you would be able to ditch mod_card. Also, grid sections can be styled which may give you some more options.
Thanks a lot for your reply, and look forward to V4.
Can you elaborate a bit more on this and how possible to make the clickable area aligned with where the tiles are displayed?
Have a great day!
What I am describing here is that the ripple for the tile icon is styled by the ::before pseudo class. So if the ripple is out of alignment of other changes, you may need to apply a mod to that styling.