Mushroom Cards Card Mod Styling/Config Guide

Can I also display the time ‘18:20’ instead of ‘time ago’?

square: false
type: grid
cards:
  - type: custom:mushroom-entity-card
    entity: sensor.garten_temp_min_daily
    primary_info: last-changed
    secondary_info: none
    layout: vertical
    icon_color: light-blue
  - type: custom:mushroom-entity-card
    entity: sensor.gw1100a_garten_temperature
    primary_info: last-changed
    secondary_info: none
    layout: vertical
    icon_color: primary
  - type: custom:mushroom-entity-card
    entity: sensor.garten_temp_max_daily
    primary_info: last-changed
    secondary_info: none
    layout: vertical
    icon_color: amber
  - type: custom:bignumber-card
    entity: sensor.garten_temp_min_daily
    scale: 22px
    title: min
    color: rgb(72,143,194)
    round: 1
    hideunit: false
  - type: custom:bignumber-card
    entity: sensor.gw1100a_garten_temperature
    scale: 22px
    title: now
    color: silver
    round: 1
    hideunit: false
  - type: custom:bignumber-card
    entity: sensor.garten_temp_max_daily
    scale: 22px
    title: max
    color: gold
    round: 1
    hideunit: false
columns: 3

eliminate this line icon_color: '' and use .: | in your mod. I made the shape color orange so you know it’s working.

type: conditional
conditions:
  - condition: state
    entity: sensor.water_softener_salt_level
    state: ok
card:
  type: custom:mushroom-template-card
  primary: Water softener salt tank empty!
  secondary: Please refill
  icon: mdi:water
  tap_action:
    action: none
  hold_action:
    action: none
  double_tap_action:
    action: none
  badge_color: white
  card_mod:
   style:
     mushroom-shape-icon$: |
      .shape {
        --shape-color: orange !important;
      }
     .: |
      ha-state-icon {
        color: white;
          }
      ha-card {
        background-color: #8c0101;
        --card-primary-color: white;
        --card-secondary-color: white;
      }

Excellent - thanks very much :slight_smile: :grinning:

I’m modifiying a few styles/colors globally in a mushroom theme as below. As part of that, I would like to modify the color of all buttons on all mushroom cards, e.g., playback controls on the media card. I thought that the last line might do that. I have also tried a few other key names, but I can’t find the right one. Any suggestions? Thanks.

Mushroom Rounded Shadow:
    # Home Assistant override
    ha-card-border-width: 0
    ha-card-border-radius: 36px
    primary-color: rgb(2, 119, 189)
    accent-color:  rgb(3,218,198)
    modes:
        light:
            ha-card-box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.16)
        dark:
            primary-background-color: rgb(18, 15, 18)
            app-header-background-color: rgb(24, 20, 24)
            ha-card-box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.5)
            mushroom-button-bg-color: rgb(24, 210, 24)

Like this? You’ll have to switch to a template card.

Code for one card

type: custom:mushroom-template-card
icon: mdi:arrow-down-bold
icon_color: light-blue
entity: sensor.garten_temp_min_daily
layout: vertical
primary: |
      {{ as_timestamp (states.sensor.garten_temp_min_daily.last_changed) | timestamp_custom('%I/%M%p)') | replace("(0", "") | replace("/", ":") | replace (")", "") }}
1 Like

so great… thanks a lot :ok_hand:

Can anybody help me with this? There’s a box around the button (visible only when pressing and holding) that messes with the slider, I can’t slide the area within the box.

  - type: custom:vertical-stack-in-card
    cards:
      - features:
          - style: slider
            type: numeric-input
        type: tile
        entity: input_number.water_heater_duration
        tap_action:
          action: none
        icon_tap_action:
          action: none
      - type: custom:mushroom-chips-card
        chips:
          - type: entity
            entity: binary_sensor.dev_hot_water
            icon: mdi:power
            icon_color: black
            content_info: none
            tap_action:
              action: toggle
            hold_action:
              action: none
            double_tap_action:
              action: none
        alignment: center
        card_mod:
          style: |
            ha-card {
              margin: -4px 0px 10px;
              --chip-background: rgba(var(--rgb-disabled), 0.15);
              --chip-border-width: 0;
              --chip-border-radius: 12px;
              --chip-height: 46px;
              --chip-padding: 62px;
              --chip-spacing: 0px;
            }

Not sure how, you get such a square, i copied you code, and it work/looks fine here !
However i have Custom-Theme, so it might play a role here.

However , ive never seen “padding” used this way !
“padding” is normally applied in All directions , and if you remove it, it works

I’m not really good with CSS, I got the code from a post on another thread. If I remove the padding, I just get a chip that doesn’t resemble a button at all. Is there any other way to change its width?

Try this


    card_mod:
      style:
        mushroom-entity-chip:nth-child(1)$: |
          ha-state-icon {
              padding-top: 23px;
              padding-left: 31px;
              height: 46px;
              width: 62px !important;
          }
        .: |
          ha-card {
            --chip-background: rgba(var(--rgb-disabled), 0.15);
            --chip-border-width: 0;
            --chip-border-radius: 12px;
            --chip-height: 46px !important;
            --chip-spacing: 0px;
          }
    alignment: center

Maybe play around some with the values

1 Like

Does this work better for you?

type: custom:vertical-stack-in-card
cards:
      - features:
          - style: slider
            type: numeric-input
        type: tile
        entity: input_number.water_heater_duration
        tap_action:
          action: none
        icon_tap_action:
          action: none
      - type: custom:mushroom-chips-card
        chips:
         - type: entity
           icon: mdi:power
           entity: binary_sensor.dev_hot_water
           content_info: none
           tap_action:
              action: toggle
           card_mod:
             style: |
               ha-card {
                 --chip-background: transparent;
                 --chip-icon-size: 30px;
                 border: none;
                 --icon-color: black;
        card_mod:
             style: |
               ha-card {
                 padding-bottom: 15px;
                 }
        alignment: center
1 Like

Thank you everyone, I think this works a bit better for me

        card_mod:
          style:
            mushroom-entity-chip:nth-child(1)$: |
              ha-state-icon {
                  padding-top: 23px;
                  padding-left: 40px;
                  height: 46px;
                  width: 62px !important;
              }
            .: |
              ha-card {
                padding-bottom: 12px;
                --chip-background: rgba(var(--rgb-disabled), 0.15);
                --chip-border-width: 0;
                --chip-border-radius: 12px;
                --chip-height: 46px !important;
                --chip-spacing: 0px;
              }

Again, thank you!

You could use Liquid’s --chip-icon-size: 30px;

So you have better proportion

I totally missed you had a grey square around the button in the picture :rofl:

1 Like

I decided to rebuild my UI with Mushroom cards, I’m very satisfied with this

4 Likes

I finally found a card which I like for my floors and play with this card a little bit, but now I want to add a badge to the floor icon which will show how many lights is on at this particular floor and it will pop up only when this lights is On. But don’t even have a clue how to do this. Please help me with this . Thank you

image

type: custom:stack-in-card
mode: vertical
card_mod:
  style: |
    ha-card {
      --vertical-stack-card-gap: 10px;
      background: url('/local/MyPictures/rock wall.jpg');
      background-size: 200%;
    }
cards:
  - type: custom:collapsable-cards
    title_card:
      type: custom:mushroom-template-card
      primary: First Floor
      secondary: '{{ states(''light.first_floor_lights'') }}'
      icon: mdi:home-floor-1
      icon_color: >-
        {%if is_state('light.first_floor_lights', 'off') %} teal {% else %}
        amber {% endif %}
      card_mod:
        style: |
          ha-card {
            background: none !important;
          }
    cards:
      - type: custom:stack-in-card
        mode: vertical
        card_mod:
          style: |
            ha-card {
              --vertical-stack-card-gap: 10px;
              background: url('/local/MyPictures/rock wall.jpg');
              background-size: 200%;
            }
        cards:
          - type: vertical-stack
            cards:
              - type: horizontal-stack
                cards:
                  - type: custom:mushroom-chips-card
                    chips:
                      - type: entity
              - type: horizontal-stack
                cards:
                  - type: custom:mushroom-template-card
                    primary: Living Room
                    icon: mdi:sofa
                    icon_color: teal
                    card_mod:
                      style: |
                        ha-card {              
                          {% if states('light.living_room_lights') == 'on' %}
                          box-shadow: 0px 0px 5px 5px #CBC3E3 !important;
                          {% else %}
                          box-shadow: 5px 10px 5px -3px rgba(0,0,0,0.75);
                          {% endif %}      
                          {% if is_state('light.living_room_lights','on') %}
                          background: rgba(255, 152, 0, 0.1) !important;
                          {% endif %}
                          --card-primary-font-size: 10px;
                          --card-primary-font-weight: bold;
                          width: 150px;
                          margin-left: 5px !important;                  
                        }
                    tap_action:
                      action: navigate
                      navigation_path: living-room-1
                    fill_container: true
                    layout: horizontal
                    multiline_secondary: false
                  - type: custom:mushroom-template-card
                    primary: Kitchen
                    icon: mdi:pot-steam
                    icon_color: teal
                    card_mod:
                      style: |
                        ha-card {              
                          {% if states('light.kitchen_lights_2') == 'on' %}
                          box-shadow: 0px 0px 5px 5px #CBC3E3 !important;
                          {% else %}
                          box-shadow: 5px 10px 5px -3px rgba(0,0,0,0.75);
                          {% endif %}      
                          {% if is_state('light.kitchen_lights_2','on') %}
                          background: rgba(255, 152, 0, 0.1) !important;
                          {% endif %}
                          --card-primary-font-size: 10px;
                          --card-primary-font-weight: bold;
                          width: 150px;
                        }
                    tap_action:
                      action: navigate
                      navigation_path: kitchen
                    fill_container: true
                    layout: horizontal
                    multiline_secondary: false
              - type: horizontal-stack
                cards:
                  - type: custom:mushroom-template-card
                    primary: Hallway
                    icon: mdi:hat-fedora
                    icon_color: teal
                    card_mod:
                      style: |
                        ha-card {              
                          {% if states('light.hallway_lights') == 'on' %}
                          box-shadow: 0px 0px 5px 5px #CBC3E3 !important;
                          {% else %}
                          box-shadow: 5px 10px 5px -3px rgba(0,0,0,0.75);
                          {% endif %}      
                          {% if is_state('light.hallway_lights','on') %}
                          background: rgba(255, 152, 0, 0.1) !important;
                          {% endif %}
                          --card-primary-font-size: 10px;
                          --card-primary-font-weight: bold;
                          width: 150px;
                          margin-left: 5px !important;
                        }
                    tap_action:
                      action: navigate
                      navigation_path: hallway
                    fill_container: true
                    layout: horizontal
                    multiline_secondary: false
                  - type: custom:mushroom-template-card
                    primary: My Bathroom
                    icon: mdi:shower-head
                    icon_color: teal
                    card_mod:
                      style: |
                        ha-card {              
                          {% if states('light.my_bathroom_lights') == 'on' %}
                          box-shadow: 0px 0px 5px 5px #CBC3E3 !important;
                          {% else %}
                          box-shadow: 5px 10px 5px -3px rgba(0,0,0,0.75);
                          {% endif %}      
                          {% if is_state('light.my_bathroom_lights','on') %}
                          background: rgba(255, 152, 0, 0.1) !important;
                          {% endif %}
                          --card-primary-font-size: 10px;
                          --card-primary-font-weight: bold;
                          width: 150px;                  
                        }
                    tap_action:
                      action: navigate
                      navigation_path: my-bathroom
                    fill_container: true
                    layout: horizontal
                    multiline_secondary: false
              - type: horizontal-stack
                cards:
                  - type: custom:mushroom-template-card
                    primary: Garage
                    icon: mdi:go-kart
                    icon_color: teal
                    card_mod:
                      style: |
                        ha-card {              
                          {% if states('light.garage_lights_light') == 'on' %}
                          box-shadow: 0px 0px 5px 5px #CBC3E3 !important;
                          {% else %}
                          box-shadow: 5px 10px 5px -3px rgba(0,0,0,0.75);
                          {% endif %}      
                          {% if is_state('light.garage_lights_light','on') %}
                          background: rgba(255, 152, 0, 0.1) !important;
                          {% endif %}
                          --card-primary-font-size: 10px;
                          --card-primary-font-weight: bold;
                          width: 150px;
                          margin-left: 5px !important;
                        }
                    tap_action:
                      action: navigate
                      navigation_path: garage
                    fill_container: true
                    layout: horizontal
                    multiline_secondary: false
                  - type: custom:mushroom-template-card
                    primary: Kids Room
                    icon: mdi:teddy-bear
                    icon_color: teal
                    card_mod:
                      style: |
                        ha-card {              
                          {% if states('light.kids_fan_down_light') == 'on' %}
                          box-shadow: 0px 0px 5px 5px #CBC3E3 !important;
                          {% else %}
                          box-shadow: 5px 10px 5px -3px rgba(0,0,0,0.75);
                          {% endif %}      
                          {% if is_state('light.kids_fan_down_light','on') %}
                          background: rgba(255, 152, 0, 0.1) !important;
                          {% endif %}
                          --card-primary-font-size: 10px;
                          --card-primary-font-weight: bold;
                          width: 150px;
                        }
                    tap_action:
                      action: navigate
                      navigation_path: kids-room
                    fill_container: true
                    layout: horizontal
                    multiline_secondary: false
              - type: horizontal-stack
                cards:
                  - type: custom:mushroom-template-card
                    primary: Outside
                    icon: phu:outside
                    icon_color: teal
                    card_mod:
                      style: |
                        ha-card {              
                          {% if states('light.outside_lights') == 'on' %}
                          box-shadow: 0px 0px 5px 5px #CBC3E3 !important;
                          {% else %}
                          box-shadow: 5px 10px 5px -3px rgba(0,0,0,0.75);
                          {% endif %}      
                          {% if is_state('light.outside_lights','on') %}
                          background: rgba(255, 152, 0, 0.1) !important;
                          {% endif %}
                          --card-primary-font-size: 10px;
                          --card-primary-font-weight: bold;
                          width: 150px;
                        }
                    tap_action:
                      action: navigate
                      navigation_path: outside
                    fill_container: true
                    layout: horizontal
                    multiline_secondary: false
                  - type: custom:mushroom-template-card
                    primary: Weather
                    icon: mdi:theme-light-dark
                    icon_color: teal
                    card_mod:
                      style: |
                        ha-card {              
                          --card-primary-font-weight: bold;
                          --card-primary-font-size: 10px;
                          width: 150px;
                          margin-left: 5px !important;
                        }
                    tap_action:
                      action: navigate
                      navigation_path: weather
                    fill_container: true
                    layout: horizontal
                    multiline_secondary: false
              - type: horizontal-stack
                cards:
                  - type: custom:mushroom-chips-card
                    chips:
                      - type: entity
  - type: custom:collapsable-cards
    title_card:
      type: custom:mushroom-template-card
      primary: Second Floor
      secondary: '{{ states(''light.second_floor_lights'') }}'
      icon: mdi:home-floor-2
      icon_color: >-
        {%if is_state('light.second_floor_lights', 'off') %} teal {% else %}
        amber {% endif %}
      card_mod:
        style: |
          ha-card {
            background: none !important;
          }
    cards:
      - type: custom:stack-in-card
        mode: vertical
        card_mod:
          style: |
            ha-card {
              --vertical-stack-card-gap: 10px;
              background: url('/local/MyPictures/rock wall.jpg');
              background-size: 200%;
            }
        cards:
          - type: vertical-stack
            cards:
              - type: horizontal-stack
                cards:
                  - type: custom:mushroom-chips-card
                    chips:
                      - type: entity
              - type: horizontal-stack
                cards:
                  - type: custom:mushroom-template-card
                    primary: Upstairs
                    icon: mdi:escalator-up
                    icon_color: teal
                    card_mod:
                      style: |
                        ha-card {              
                          {% if states('light.upstairs_lights') == 'on' %}
                          box-shadow: 0px 0px 5px 5px #CBC3E3 !important;
                          {% else %}
                          box-shadow: 5px 10px 5px -3px rgba(0,0,0,0.75);
                          {% endif %}      
                          {% if is_state('light.upstairs_lights','on') %}
                          background: rgba(255, 152, 0, 0.1) !important;
                          {% endif %}
                          --card-primary-font-size: 10px;
                          width: 150px;
                          margin-left: 5px !important;
                          --card-primary-font-weight: bold !important;
                        }
                    tap_action:
                      action: navigate
                      navigation_path: upstairs
                    fill_container: true
                    layout: horizontal
                    multiline_secondary: false
                  - type: custom:mushroom-template-card
                    primary: Master Bedroom
                    icon: mdi:bed-king
                    icon_color: teal
                    card_mod:
                      style: |
                        ha-card {              
                          {% if states('light.master_bedroom_lights') == 'on' %}
                          box-shadow: 0px 0px 5px 5px #CBC3E3 !important;
                          {% else %}
                          box-shadow: 5px 10px 5px -3px rgba(0,0,0,0.75);
                          {% endif %}      
                          {% if is_state('light.master_bedroom_lights','on') %}
                          background: rgba(255, 152, 0, 0.1) !important;
                          {% endif %} 
                          --card-primary-font-size: 10px;
                          width: 150px;
                          --card-primary-font-weight: bold !important;
                        }
                    tap_action:
                      action: navigate
                      navigation_path: master-bedroom
                    fill_container: true
                    layout: horizontal
                    multiline_secondary: false
              - type: horizontal-stack
                cards:
                  - type: custom:mushroom-template-card
                    primary: Sonia Room
                    icon: mdi:zodiac-leo
                    icon_color: teal
                    card_mod:
                      style: |
                        ha-card {              
                          {% if states('light.sonia_s_bulbs') == 'on' %}
                          box-shadow: 0px 0px 5px 5px #CBC3E3 !important;
                          {% else %}
                          box-shadow: 5px 10px 5px -3px rgba(0,0,0,0.75);
                          {% endif %}      
                          {% if is_state('light.sonia_s_bulbs','on') %}
                          background: rgba(255, 152, 0, 0.1) !important;
                          {% endif %}
                          --card-primary-font-size: 10px;
                          width: 150px;
                          margin-left: 5px !important;
                          --card-primary-font-weight: bold;
                        }
                    tap_action:
                      action: navigate
                      navigation_path: sonia-room
                    fill_container: true
                    layout: horizontal
                    multiline_secondary: false
                  - type: custom:mushroom-template-card
                    primary: Artem Room
                    icon: mdi:zodiac-taurus
                    icon_color: teal
                    card_mod:
                      style: |
                        ha-card {              
                          {% if states('light.artem_fan') == 'on' %}
                          box-shadow: 0px 0px 5px 5px #CBC3E3 !important;
                          {% else %} 
                          box-shadow: 5px 10px 5px -3px rgba(0,0,0,0.75);
                          {% endif %}      
                          {% if is_state('light.artem_fan','on') %}
                          background: rgba(255, 152, 0, 0.1) !important;
                          {% endif %}
                          --card-primary-font-size: 10px;
                          width: 150px;
                          --card-primary-font-weight: bold;
                        }
                    tap_action:
                      action: navigate
                      navigation_path: artem-room
                    fill_container: true
                    layout: horizontal
                    multiline_secondary: false
              - type: horizontal-stack
                cards:
                  - type: custom:mushroom-chips-card
                    chips:
                      - type: entity
  - type: custom:collapsable-cards
    title_card:
      type: custom:mushroom-template-card
      primary: Basement
      secondary: '{{ states(''light.basement_lights_all'') }}'
      icon: mdi:home-floor-b
      icon_color: >-
        {%if is_state('light.basement_lights_all', 'off') %} teal {% else %}
        amber {% endif %}
      card_mod:
        style: |
          ha-card {
            background: none !important;
          }
    cards:
      - type: custom:stack-in-card
        mode: vertical
        card_mod:
          style: |
            ha-card {
              --vertical-stack-card-gap: 10px;
              background: url('/local/MyPictures/rock wall.jpg');
              background-size: 200%;
            }        
        cards:
          - type: vertical-stack
            cards:
              - type: horizontal-stack
                cards:
                  - type: custom:mushroom-chips-card
                    chips:
                      - type: entity
              - type: horizontal-stack
                cards:
                  - type: custom:mushroom-template-card
                    primary: Basement
                    icon: mdi:escalator-down
                    icon_color: teal
                    card_mod:
                      style: |
                        ha-card {              
                          {% if states('light.basement_lights') == 'on' %}
                          box-shadow: 0px 0px 5px 5px #CBC3E3 !important;
                          {% else %}
                          box-shadow: 5px 10px 5px -3px rgba(0,0,0,0.75);
                          {% endif %}      
                          {% if is_state('light.basement_lights','on') %}
                          background: rgba(255, 152, 0, 0.1) !important;
                          {% endif %}
                          --card-primary-font-size: 10px;
                          --card-primary-font-weight: bold;
                          width: 150px;
                          margin-left: 5px !important;
                        }
                    tap_action:
                      action: navigate
                      navigation_path: basement
                    fill_container: true
                    layout: horizontal
                    multiline_secondary: false
                  - type: custom:mushroom-template-card
                    primary: Laundry
                    icon: mdi:tumble-dryer
                    icon_color: teal
                    card_mod:
                      style: |
                        ha-card {              
                          {% if states('light.laundry_vanity_light_light') == 'on' %}
                          box-shadow: 0px 0px 5px 5px #CBC3E3 !important;
                          {% else %}
                          box-shadow: 5px 10px 5px -3px rgba(0,0,0,0.75);
                          {% endif %}      
                          {% if is_state('light.laundry_vanity_light_light','on') %}
                          background: rgba(255, 152, 0, 0.1) !important;
                          {% endif %}
                          --card-primary-font-size: 10px;
                          --card-primary-font-weight: bold;
                          width: 150px;
                        }
                    tap_action:
                      action: navigate
                      navigation_path: laundry
                    fill_container: true
                    layout: horizontal
                    multiline_secondary: false
              - type: horizontal-stack
                cards:
                  - type: custom:mushroom-template-card
                    primary: Utility Room
                    icon: mdi:water-boiler
                    icon_color: teal
                    card_mod:
                      style: |
                        ha-card {              
                          {% if states('light.utility_room_light_light_2') == 'on' %}
                          box-shadow: 0px 0px 5px 5px #CBC3E3 !important;
                          {% else %}
                          box-shadow: 5px 10px 5px -3px rgba(0,0,0,0.75);
                          {% endif %}      
                          {% if is_state('light.utility_room_light_light_2','on') %}
                          background: rgba(255, 152, 0, 0.1) !important;
                          {% endif %}
                          --card-primary-font-size: 10px;
                          --card-primary-font-weight: bold;
                          width: 150px;
                          margin-left: 5px !important;
                        }
                    tap_action:
                      action: navigate
                      navigation_path: utility-room
                    fill_container: true
                    layout: horizontal
                    multiline_secondary: false
                  - type: custom:mushroom-template-card
                    primary: HA Info
                    icon: ios:cpu
                    icon_color: teal
                    card_mod:
                      style: |
                        ha-card {              
                          --card-primary-font-size: 10px;
                          width: 150px;
                        }
                    tap_action:
                      action: navigate
                      navigation_path: ha-information
                    fill_container: true
                    layout: horizontal
                    multiline_secondary: false
              - type: horizontal-stack
                cards:
                  - type: custom:mushroom-chips-card
                    chips:
                      - type: entity

I take it my other post just helped or do you still need assistance? Just saw your post.

type: custom:stack-in-card
mode: vertical
card_mod:
  style: |
    ha-card {
      --vertical-stack-card-gap: 10px;
      background: url('/local/MyPictures/rock wall.jpg');
      background-size: 200%;
    }
cards:
  - type: custom:collapsable-cards
    title_card:
      type: custom:mushroom-template-card
      primary: First Floor
      secondary: '{{ states(''light.first_floor_lights'') }}'
      icon: mdi:home-floor-1
      icon_color: >-
        {%if is_state('light.first_floor_lights', 'off') %} teal {% else %}
        amber {% endif %}
      card_mod:
        style: |
          ha-card {
            background: none !important;
              }
          ha-card:after {
                    content: " {{ states.light | rejectattr('attributes.entity_id', 'defined') | selectattr('state', 'eq', 'on') | list | count }}";
                    position: absolute;
                    display: flex;
                    justify-content: center;
                    align-items: center;
                    background: teal;
                    color: var(--card-background-color);
                    font-weight: bolder;
                    border-radius: 50% 50%;
                    top: -5px;
                    right: -15px;
                    width: 20px;
                    height: 20px;
                    font-size: 10px;
                                  }
              
    cards:
      - type: custom:stack-in-card
        mode: vertical
        card_mod:
          style: |
            ha-card {
              --vertical-stack-card-gap: 10px;
              background: url('/local/MyPictures/rock wall.jpg');
              background-size: 200%;
            }
        cards:
          - type: vertical-stack
            cards:
              - type: horizontal-stack
                cards:
                  - type: custom:mushroom-chips-card
                    chips:
                      - type: entity
              - type: horizontal-stack
                cards:
                  - type: custom:mushroom-template-card
                    primary: Living Room
                    icon: mdi:sofa
                    icon_color: teal
                    card_mod:
                      style: |
                        ha-card {              
                          {% if states('light.living_room_lights') == 'on' %}
                          box-shadow: 0px 0px 5px 5px #CBC3E3 !important;
                          {% else %}
                          box-shadow: 5px 10px 5px -3px rgba(0,0,0,0.75);
                          {% endif %}      
                          {% if is_state('light.living_room_lights','on') %}
                          background: rgba(255, 152, 0, 0.1) !important;
                          {% endif %}
                          --card-primary-font-size: 10px;
                          --card-primary-font-weight: bold;
                          width: 150px;
                          margin-left: 5px !important;                  
                          }




                        
                    tap_action:
                      action: navigate
                      navigation_path: living-room-1
                    fill_container: true
                    layout: horizontal
                    multiline_secondary: false
                  - type: custom:mushroom-template-card
                    primary: Kitchen
                    icon: mdi:pot-steam
                    icon_color: teal
                    card_mod:
                      style: |
                        ha-card {              
                          {% if states('light.kitchen_lights_2') == 'on' %}
                          box-shadow: 0px 0px 5px 5px #CBC3E3 !important;
                          {% else %}
                          box-shadow: 5px 10px 5px -3px rgba(0,0,0,0.75);
                          {% endif %}      
                          {% if is_state('light.kitchen_lights_2','on') %}
                          background: rgba(255, 152, 0, 0.1) !important;
                          {% endif %}
                          --card-primary-font-size: 10px;
                          --card-primary-font-weight: bold;
                          width: 150px;
                        }
                    tap_action:
                      action: navigate
                      navigation_path: kitchen
                    fill_container: true
                    layout: horizontal
                    multiline_secondary: false
              - type: horizontal-stack
                cards:
                  - type: custom:mushroom-template-card
                    primary: Hallway
                    icon: mdi:hat-fedora
                    icon_color: teal
                    card_mod:
                      style: |
                        ha-card {              
                          {% if states('light.hallway_lights') == 'on' %}
                          box-shadow: 0px 0px 5px 5px #CBC3E3 !important;
                          {% else %}
                          box-shadow: 5px 10px 5px -3px rgba(0,0,0,0.75);
                          {% endif %}      
                          {% if is_state('light.hallway_lights','on') %}
                          background: rgba(255, 152, 0, 0.1) !important;
                          {% endif %}
                          --card-primary-font-size: 10px;
                          --card-primary-font-weight: bold;
                          width: 150px;
                          margin-left: 5px !important;
                        }
                    tap_action:
                      action: navigate
                      navigation_path: hallway
                    fill_container: true
                    layout: horizontal
                    multiline_secondary: false
                  - type: custom:mushroom-template-card
                    primary: My Bathroom
                    icon: mdi:shower-head
                    icon_color: teal
                    card_mod:
                      style: |
                        ha-card {              
                          {% if states('light.my_bathroom_lights') == 'on' %}
                          box-shadow: 0px 0px 5px 5px #CBC3E3 !important;
                          {% else %}
                          box-shadow: 5px 10px 5px -3px rgba(0,0,0,0.75);
                          {% endif %}      
                          {% if is_state('light.my_bathroom_lights','on') %}
                          background: rgba(255, 152, 0, 0.1) !important;
                          {% endif %}
                          --card-primary-font-size: 10px;
                          --card-primary-font-weight: bold;
                          width: 150px;                  
                        }
                    tap_action:
                      action: navigate
                      navigation_path: my-bathroom
                    fill_container: true
                    layout: horizontal
                    multiline_secondary: false
              - type: horizontal-stack
                cards:
                  - type: custom:mushroom-template-card
                    primary: Garage
                    icon: mdi:go-kart
                    icon_color: teal
                    card_mod:
                      style: |
                        ha-card {              
                          {% if states('light.garage_lights_light') == 'on' %}
                          box-shadow: 0px 0px 5px 5px #CBC3E3 !important;
                          {% else %}
                          box-shadow: 5px 10px 5px -3px rgba(0,0,0,0.75);
                          {% endif %}      
                          {% if is_state('light.garage_lights_light','on') %}
                          background: rgba(255, 152, 0, 0.1) !important;
                          {% endif %}
                          --card-primary-font-size: 10px;
                          --card-primary-font-weight: bold;
                          width: 150px;
                          margin-left: 5px !important;
                        }
                    tap_action:
                      action: navigate
                      navigation_path: garage
                    fill_container: true
                    layout: horizontal
                    multiline_secondary: false
                  - type: custom:mushroom-template-card
                    primary: Kids Room
                    icon: mdi:teddy-bear
                    icon_color: teal
                    card_mod:
                      style: |
                        ha-card {              
                          {% if states('light.kids_fan_down_light') == 'on' %}
                          box-shadow: 0px 0px 5px 5px #CBC3E3 !important;
                          {% else %}
                          box-shadow: 5px 10px 5px -3px rgba(0,0,0,0.75);
                          {% endif %}      
                          {% if is_state('light.kids_fan_down_light','on') %}
                          background: rgba(255, 152, 0, 0.1) !important;
                          {% endif %}
                          --card-primary-font-size: 10px;
                          --card-primary-font-weight: bold;
                          width: 150px;
                        }
                    tap_action:
                      action: navigate
                      navigation_path: kids-room
                    fill_container: true
                    layout: horizontal
                    multiline_secondary: false
              - type: horizontal-stack
                cards:
                  - type: custom:mushroom-template-card
                    primary: Outside
                    icon: phu:outside
                    icon_color: teal
                    card_mod:
                      style: |
                        ha-card {              
                          {% if states('light.outside_lights') == 'on' %}
                          box-shadow: 0px 0px 5px 5px #CBC3E3 !important;
                          {% else %}
                          box-shadow: 5px 10px 5px -3px rgba(0,0,0,0.75);
                          {% endif %}      
                          {% if is_state('light.outside_lights','on') %}
                          background: rgba(255, 152, 0, 0.1) !important;
                          {% endif %}
                          --card-primary-font-size: 10px;
                          --card-primary-font-weight: bold;
                          width: 150px;
                        }
                    tap_action:
                      action: navigate
                      navigation_path: outside
                    fill_container: true
                    layout: horizontal
                    multiline_secondary: false
                  - type: custom:mushroom-template-card
                    primary: Weather
                    icon: mdi:theme-light-dark
                    icon_color: teal
                    card_mod:
                      style: |
                        ha-card {              
                          --card-primary-font-weight: bold;
                          --card-primary-font-size: 10px;
                          width: 150px;
                          margin-left: 5px !important;
                        }
                    tap_action:
                      action: navigate
                      navigation_path: weather
                    fill_container: true
                    layout: horizontal
                    multiline_secondary: false
              - type: horizontal-stack
                cards:
                  - type: custom:mushroom-chips-card
                    chips:
                      - type: entity
  - type: custom:collapsable-cards
    title_card:
      type: custom:mushroom-template-card
      primary: Second Floor
      secondary: '{{ states(''light.second_floor_lights'') }}'
      icon: mdi:home-floor-2
      icon_color: >-
        {%if is_state('light.second_floor_lights', 'off') %} teal {% else %}
        amber {% endif %}
      card_mod:
        style: |
          ha-card {
            background: none !important;
          }
                        ha-card:after {
                        content: " {{ states.light | rejectattr('attributes.entity_id', 'defined') | selectattr('state', 'eq', 'on') | list | count }}";
                        position: absolute;
                        display: flex;
                        justify-content: center;
                        align-items: center;
                        background: red;
                        color: var(--card-background-color);
                        font-weight: bolder;
                        border-radius: 50% 50%;
                        top: -5px;
                        right: -15px;
                        width: 20px;
                        height: 20px;
                        font-size: 10px;
                                  }
          
    cards:
      - type: custom:stack-in-card
        mode: vertical
        card_mod:
          style: |
            ha-card {
              --vertical-stack-card-gap: 10px;
              background: url('/local/MyPictures/rock wall.jpg');
              background-size: 200%;
            }
        cards:
          - type: vertical-stack
            cards:
              - type: horizontal-stack
                cards:
                  - type: custom:mushroom-chips-card
                    chips:
                      - type: entity
              - type: horizontal-stack
                cards:
                  - type: custom:mushroom-template-card
                    primary: Upstairs
                    icon: mdi:escalator-up
                    icon_color: teal
                    card_mod:
                      style: |
                        ha-card {              
                          {% if states('light.upstairs_lights') == 'on' %}
                          box-shadow: 0px 0px 5px 5px #CBC3E3 !important;
                          {% else %}
                          box-shadow: 5px 10px 5px -3px rgba(0,0,0,0.75);
                          {% endif %}      
                          {% if is_state('light.upstairs_lights','on') %}
                          background: rgba(255, 152, 0, 0.1) !important;
                          {% endif %}
                          --card-primary-font-size: 10px;
                          width: 150px;
                          margin-left: 5px !important;
                          --card-primary-font-weight: bold !important;
                        }
                    tap_action:
                      action: navigate
                      navigation_path: upstairs
                    fill_container: true
                    layout: horizontal
                    multiline_secondary: false
                  - type: custom:mushroom-template-card
                    primary: Master Bedroom
                    icon: mdi:bed-king
                    icon_color: teal
                    card_mod:
                      style: |
                        ha-card {              
                          {% if states('light.master_bedroom_lights') == 'on' %}
                          box-shadow: 0px 0px 5px 5px #CBC3E3 !important;
                          {% else %}
                          box-shadow: 5px 10px 5px -3px rgba(0,0,0,0.75);
                          {% endif %}      
                          {% if is_state('light.master_bedroom_lights','on') %}
                          background: rgba(255, 152, 0, 0.1) !important;
                          {% endif %} 
                          --card-primary-font-size: 10px;
                          width: 150px;
                          --card-primary-font-weight: bold !important;
                        }
                    tap_action:
                      action: navigate
                      navigation_path: master-bedroom
                    fill_container: true
                    layout: horizontal
                    multiline_secondary: false
              - type: horizontal-stack
                cards:
                  - type: custom:mushroom-template-card
                    primary: Sonia Room
                    icon: mdi:zodiac-leo
                    icon_color: teal
                    card_mod:
                      style: |
                        ha-card {              
                          {% if states('light.sonia_s_bulbs') == 'on' %}
                          box-shadow: 0px 0px 5px 5px #CBC3E3 !important;
                          {% else %}
                          box-shadow: 5px 10px 5px -3px rgba(0,0,0,0.75);
                          {% endif %}      
                          {% if is_state('light.sonia_s_bulbs','on') %}
                          background: rgba(255, 152, 0, 0.1) !important;
                          {% endif %}
                          --card-primary-font-size: 10px;
                          width: 150px;
                          margin-left: 5px !important;
                          --card-primary-font-weight: bold;
                        }
                    tap_action:
                      action: navigate
                      navigation_path: sonia-room
                    fill_container: true
                    layout: horizontal
                    multiline_secondary: false
                  - type: custom:mushroom-template-card
                    primary: Artem Room
                    icon: mdi:zodiac-taurus
                    icon_color: teal
                    card_mod:
                      style: |
                        ha-card {              
                          {% if states('light.artem_fan') == 'on' %}
                          box-shadow: 0px 0px 5px 5px #CBC3E3 !important;
                          {% else %} 
                          box-shadow: 5px 10px 5px -3px rgba(0,0,0,0.75);
                          {% endif %}      
                          {% if is_state('light.artem_fan','on') %}
                          background: rgba(255, 152, 0, 0.1) !important;
                          {% endif %}
                          --card-primary-font-size: 10px;
                          width: 150px;
                          --card-primary-font-weight: bold;
                        }
                    tap_action:
                      action: navigate
                      navigation_path: artem-room
                    fill_container: true
                    layout: horizontal
                    multiline_secondary: false
              - type: horizontal-stack
                cards:
                  - type: custom:mushroom-chips-card
                    chips:
                      - type: entity
  - type: custom:collapsable-cards
    title_card:
      type: custom:mushroom-template-card
      primary: Basement
      secondary: '{{ states(''light.basement_lights_all'') }}'
      icon: mdi:home-floor-b
      icon_color: >-
        {%if is_state('light.basement_lights_all', 'off') %} teal {% else %}
        amber {% endif %}
      card_mod:
        style: |
          ha-card {
            background: none !important;
          }
                                  ha-card:after {
                        content: " {{ states.light | rejectattr('attributes.entity_id', 'defined') | selectattr('state', 'eq', 'on') | list | count }}";
                        position: absolute;
                        display: flex;
                        justify-content: center;
                        align-items: center;
                        background: yellow;
                        color: var(--card-background-color);
                        font-weight: bolder;
                        border-radius: 50% 50%;
                        top: -5px;
                        right: -15px;
                        width: 20px;
                        height: 20px;
                        font-size: 10px;
                                  }
    cards:
      - type: custom:stack-in-card
        mode: vertical
        card_mod:
          style: |
            ha-card {
              --vertical-stack-card-gap: 10px;
              background: url('/local/MyPictures/rock wall.jpg');
              background-size: 200%;
            }        
        cards:
          - type: vertical-stack
            cards:
              - type: horizontal-stack
                cards:
                  - type: custom:mushroom-chips-card
                    chips:
                      - type: entity
              - type: horizontal-stack
                cards:
                  - type: custom:mushroom-template-card
                    primary: Basement
                    icon: mdi:escalator-down
                    icon_color: teal
                    card_mod:
                      style: |
                        ha-card {              
                          {% if states('light.basement_lights') == 'on' %}
                          box-shadow: 0px 0px 5px 5px #CBC3E3 !important;
                          {% else %}
                          box-shadow: 5px 10px 5px -3px rgba(0,0,0,0.75);
                          {% endif %}      
                          {% if is_state('light.basement_lights','on') %}
                          background: rgba(255, 152, 0, 0.1) !important;
                          {% endif %}
                          --card-primary-font-size: 10px;
                          --card-primary-font-weight: bold;
                          width: 150px;
                          margin-left: 5px !important;
                        }
                    tap_action:
                      action: navigate
                      navigation_path: basement
                    fill_container: true
                    layout: horizontal
                    multiline_secondary: false
                  - type: custom:mushroom-template-card
                    primary: Laundry
                    icon: mdi:tumble-dryer
                    icon_color: teal
                    card_mod:
                      style: |
                        ha-card {              
                          {% if states('light.laundry_vanity_light_light') == 'on' %}
                          box-shadow: 0px 0px 5px 5px #CBC3E3 !important;
                          {% else %}
                          box-shadow: 5px 10px 5px -3px rgba(0,0,0,0.75);
                          {% endif %}      
                          {% if is_state('light.laundry_vanity_light_light','on') %}
                          background: rgba(255, 152, 0, 0.1) !important;
                          {% endif %}
                          --card-primary-font-size: 10px;
                          --card-primary-font-weight: bold;
                          width: 150px;
                        }
                    tap_action:
                      action: navigate
                      navigation_path: laundry
                    fill_container: true
                    layout: horizontal
                    multiline_secondary: false
              - type: horizontal-stack
                cards:
                  - type: custom:mushroom-template-card
                    primary: Utility Room
                    icon: mdi:water-boiler
                    icon_color: teal
                    card_mod:
                      style: |
                        ha-card {              
                          {% if states('light.utility_room_light_light_2') == 'on' %}
                          box-shadow: 0px 0px 5px 5px #CBC3E3 !important;
                          {% else %}
                          box-shadow: 5px 10px 5px -3px rgba(0,0,0,0.75);
                          {% endif %}      
                          {% if is_state('light.utility_room_light_light_2','on') %}
                          background: rgba(255, 152, 0, 0.1) !important;
                          {% endif %}
                          --card-primary-font-size: 10px;
                          --card-primary-font-weight: bold;
                          width: 150px;
                          margin-left: 5px !important;
                        }
                    tap_action:
                      action: navigate
                      navigation_path: utility-room
                    fill_container: true
                    layout: horizontal
                    multiline_secondary: false
                  - type: custom:mushroom-template-card
                    primary: HA Info
                    icon: ios:cpu
                    icon_color: teal
                    card_mod:
                      style: |
                        ha-card {              
                          --card-primary-font-size: 10px;
                          width: 150px;
                        }
                    tap_action:
                      action: navigate
                      navigation_path: ha-information
                    fill_container: true
                    layout: horizontal
                    multiline_secondary: false
              - type: horizontal-stack
                cards:
                  - type: custom:mushroom-chips-card
                    chips:
                      - type: entity

To apply areas to the light count, you can do this…

content: " {{ states.light | selectattr('state', 'eq', 'on')
            | rejectattr('name', 'search', '2nd Floor')
            | map(attribute='entity_id') | map('area_name')
            | select('in', ['Office', 'Loft', 'Bedroom', 'Master bedroom'])
            | list | count }}";

The code you have for Mushroom works fine…

That error you are getting is from a button card if I’m not mistaken.

type: custom:mushroom-entity-card
entity: input_datetime.reminder_date
icon: mdi:clock-time-eight
primary_info: state
secondary_info: none
icon_color: green
card_mod:
  style:
    mushroom-state-info$: |
      .container {
       --card-secondary-font-size: 20px;
       --card-primary-font-size: 20px;
        --card-primary-color: lime;
      }

Thank you so much, it’s working like a charm.
image

type: custom:stack-in-card
mode: vertical
card_mod:
  style: |
    ha-card {
      --vertical-stack-card-gap: 10px;
      background: url('/local/MyPictures/rock wall.jpg');
      background-size: 200%;
    }
cards:
  - type: custom:collapsable-cards
    title_card:
      type: custom:mushroom-template-card
      primary: First Floor
      secondary: '{{ states(''light.first_floor_lights'') }}'
      icon: mdi:home-floor-1
      icon_color: >-
        {%if is_state('light.first_floor_lights', 'off') %} teal {% else %}
        amber {% endif %}
      card_mod:
        style: |
          ha-card {
            background: none !important;
          }
          ha-card:after {
          content: " {{ states.light | selectattr('state', 'eq', 'on')
            | rejectattr('name', 'search', 'First Floor')
            | map(attribute='entity_id') | map('area_name')
            | select('in', ['Living Room', 'Kitchen', 'Hallway','Kids Room','Garage','Outside', 'My Bathroom'])
            | list | count }}";
            position: absolute;
            display: flex;
            justify-content: center;
            align-items: center;
            background: teal;
            color: var(--card-background-color);
            font-weight: bolder;
            border-radius: 50% 50%;
            top: -5px;
            left: 40px;
            width: 20px;
            height: 20px;
            font-size: 10px;
            }
    cards:
      - type: custom:stack-in-card
        mode: vertical
        card_mod:
          style: |
            ha-card {
              --vertical-stack-card-gap: 10px;
              background: url('/local/MyPictures/rock wall.jpg');
              background-size: 200%;
            }
        cards:
          - type: vertical-stack
            cards:
              - type: horizontal-stack
                cards:
                  - type: custom:mushroom-chips-card
                    chips:
                      - type: entity
              - type: horizontal-stack
                cards:
                  - type: custom:mushroom-template-card
                    primary: Living Room
                    icon: mdi:sofa
                    icon_color: teal
                    card_mod:
                      style: |
                        ha-card {              
                          {% if states('light.living_room_lights') == 'on' %}
                          box-shadow: 0px 0px 5px 5px #CBC3E3 !important;
                          {% else %}
                          box-shadow: 5px 10px 5px -3px rgba(0,0,0,0.75);
                          {% endif %}      
                          {% if is_state('light.living_room_lights','on') %}
                          background: rgba(255, 152, 0, 0.1) !important;
                          {% endif %}
                          --card-primary-font-size: 10px;
                          --card-primary-font-weight: bold;
                          width: 150px;
                          margin-left: 5px !important;                  
                        }
                    tap_action:
                      action: navigate
                      navigation_path: living-room-1
                    fill_container: true
                    layout: horizontal
                    multiline_secondary: false
                  - type: custom:mushroom-template-card
                    primary: Kitchen
                    icon: mdi:pot-steam
                    icon_color: teal
                    card_mod:
                      style: |
                        ha-card {              
                          {% if states('light.kitchen_lights_2') == 'on' %}
                          box-shadow: 0px 0px 5px 5px #CBC3E3 !important;
                          {% else %}
                          box-shadow: 5px 10px 5px -3px rgba(0,0,0,0.75);
                          {% endif %}      
                          {% if is_state('light.kitchen_lights_2','on') %}
                          background: rgba(255, 152, 0, 0.1) !important;
                          {% endif %}
                          --card-primary-font-size: 10px;
                          --card-primary-font-weight: bold;
                          width: 150px;
                        }
                    tap_action:
                      action: navigate
                      navigation_path: kitchen
                    fill_container: true
                    layout: horizontal
                    multiline_secondary: false

I will keep this card, not the other which I was ask for help earlier.

1 Like

I’ve increased the font size in a template card which is nested in a grid card. The descenders on the bottom row (the ‘g’ etc) are truncated as obviously something is limiting that space available for the text to display. What element do I need to modify for that to properly show?

Screenshot 2024-03-25 212655

The code for one of the template cards:

  - type: custom:mushroom-template-card
    primary: Hall
    secondary: Night
    icon: hue:bulb-filament
    entity: scene.hallway_night_dim
    icon_color: '{{ ''light-green'' if states(''light.hallway'') == ''on'' else ''dark-grey'' }}'
    card_mod:
      style:
        mushroom-state-info$: |
          .container {
           --card-primary-font-size: 20px;
           --card-secondary-font-size: 18px;
          }
        .: |
          ha-card {
            height: 80px !important;
            padding-bottom: 10px !important;
            padding-top: 10px !important;
          }
    badge_icon: ''
    badge_color: ''

I appreciate there are so many requests for help here - it is much appreciated!

Thanks.