not sure where this should go, but since I did pose the question myself, on whether we could limit the width of the badges section to 1 column with card_mod
, please let me post this here too.
in the badges: section, entities with a longer name/state get the size of that length, and if you have a few, the width of the badges overflows the single column width I use in all my views, making that a bit of a top heavy section.
it made me want to look for an alternative way to group those new badges, but if you use the regular badge syntax, that doesnt work, as it will show a different card type when using type: entity
Butā¦ we have been card_modding the badges, and use the type: custom:hui-entity-badge
So I figured why not try to use that in the Sections section too, and have the Frontend pick the right card with that.
A single card will occupy the full column width, which looks silly of course.
However, a set of them inside a grid looks rather nice
and look what that does to the sizing (now controlled by the column number in the grid) and text word break.
can also have a less occupied grid, and the badges still show nicely organized
its not perfect, as badges with too long a txt will overflow on Mobileā¦ Iāve settled for columns: 3
in the grid and hope the state of those longer badge entities will abideā¦
sections:
- cards:
- type: grid
columns: 3
square: false
cards:
- !include /config/dashboard/badges/badge_meteoalarm_brabant.yaml
- !include /config/dashboard/badges/badge_meteoalarm_brabant.yaml
- type: custom:mod-card
card:
type: custom:hui-entity-badge
entity: weather.buienradar
<<: &badge_icon
card_mod:
style:
hui-entity-badge:
$: |
ha-state-icon {
--mdc-icon-size: 24px;
- type: custom:mod-card
card:
type: custom:hui-entity-badge
entity: weather.buienradar
<<: *badge_icon
- type: custom:mod-card
card:
type: custom:hui-entity-badge
entity: weather.buienradar
<<: *badge_icon
one could even add a few empty cards after the conditional alarm badges, so they are singled out on a row, getting even more attention, options galore.