Hi guys, help needed. I cannot figure on my own could it be possible to fix height of right side small buttons to auto fit height of left big button, independently of screen size, app/browser, etc.
Just for note: This was done in minimalist UI. There is a little different behavior if I’m using this code on lovelace normal way, i.e. right side buttons has bigger height but left side big button. Also, on lovelace, I can fix this with aspect_ratio: 27/15
for small buttons, and this would fit perfectly for all screens. But here, on minimalist, aspect_ratio: 26/19
would work for PC and so so for wall mounted tablet, but not for Android app on phone. I believe this is more question for this topic, but for minimalist UI, cause I need to style Button Card.
This would be basic code. Since question is regarding UI only, I reduced code to barely minimum for clear overview.
title: "Test"
path: "test"
cards:
- type: 'horizontal-stack'
cards:
- type: "custom:button-card"
template: card_media_player
entity: media_player.lg_tv
variables:
ulm_card_media_player_enable_controls: true
ulm_card_media_player_enable_volume_slider: true
- type: 'vertical-stack'
cards:
- type: 'horizontal-stack'
cards:
- type: "custom:button-card"
entity: media_player.lg_tv
- type: "custom:button-card"
entity: media_player.lg_tv
- type: 'horizontal-stack'
cards:
- type: "custom:button-card"
entity: media_player.lg_tv
- type: "custom:button-card"
entity: media_player.lg_tv
As said, if I add e.g. aspect_ratio: 26/19
, this would “fix” the problem on PC, but not on phone:
- type: 'vertical-stack'
cards:
- type: 'horizontal-stack'
cards:
- type: "custom:button-card"
entity: media_player.lg_tv
aspect_ratio: 26/19
- type: "custom:button-card"
entity: media_player.lg_tv
aspect_ratio: 26/19
- type: 'horizontal-stack'
cards:
- type: "custom:button-card"
entity: media_player.lg_tv
aspect_ratio: 26/19
- type: "custom:button-card"
entity: media_player.lg_tv
aspect_ratio: 26/19
PC:
Phone:
I really cannot find is there some styling option which can auto-scale height of right side small buttons to fit the height of left side big button. I’m not sure if this is possible at all, since left side big button is child of horizontal-stack, which is two depth step up from horizontal-stack where small buttons are.
Or, is there some better approach? I’m not lazy to rewrite code completely.
Thanks.