Continuing the discussion from Customize tile card icon background using card-mod:
top row is plain tile card, bottom is mushroom-template, as created in Mushroom Cards - Build a beautiful dashboard easily 🍄 - #5208 by Mariusthvdb by @weppa
my hope is to create the same percentage border in the tile card.
yaml for current tile card:
type: custom:hui-element
card_type: horizontal-stack
cards:
- entity: sensor.epson_ink_level_black
color: black
<<: &card
type: tile
icon: mdi:water
name: ' '
vertical: true
tap_action:
action: more-info
- entity: sensor.epson_ink_level_cyan
color: cyan
<<: *card
- entity: sensor.epson_ink_level_magenta
color: magenta
<<: *card
- entity: sensor.epson_ink_level_yellow
color: yellow
<<: *card
- entity: sensor.epson_ink_level_waste
color: disabled
<<: *card
yaml for the mushroom-card:
type: custom:hui-element
card_type: horizontal-stack
cards:
- entity: sensor.epson_ink_level_black
icon_color: black
<<: &card
type: custom:mushroom-template-card
icon: mdi:water
layout: vertical
tap_action:
action: more-info
hold_action:
action: none
double_tap_action:
action: none
secondary: >
{{states(entity)}} %
card_mod:
style:
mushroom-shape-icon$: |
.shape {
background: radial-gradient(var(--card-background-color) 60%,
transparent calc(60% + 1px)),
conic-gradient(rgb(var(--rgb-{{config.icon_color}})) {{states(config.entity)}}% 0%,
var(--card-background-color) 0% 100%);
}
.shape:after {
content: "";
height: 100%;
width: 100%;
position: absolute;
border-radius: var(--icon-border-radius);
background: rgba(var(--rgb-{{config.icon_color}}), 0.2);
}
- entity: sensor.epson_ink_level_cyan
icon_color: cyan
<<: *card
- entity: sensor.epson_ink_level_magenta
icon_color: pink #magenta does not work in the Mushroom card somehow
<<: *card
- entity: sensor.epson_ink_level_yellow
icon_color: yellow
<<: *card
- entity: sensor.epson_ink_level_waste
icon_color: disabled
<<: *card
I did try the dom path settings in the linked post above, but no changes.
Would appreciate some assistance, because it is a real improvement on the Tile card as it is