šŸ”¹ Card-mod - Add css styles to any lovelace card

Try this instead

type: custom:mod-card
style: |
  ha-card {
    background: var(--ha-card-background) !important;
    box-shadow: var(--ha-card-box-shadow) !important;
    The rest of your styles go here  
  }
card:
  type: vertical-stack
  cards:
    - type: entities
      ...etc...
1 Like

Thanks Thomasā€¦ just getting these all the time now. If I check the states, the entity doesnā€™t exist, hence of course the card doesnā€™t show them - or shows ā€œEntity not availableā€ - but why is auto-entities not refreshing when the entity disappears from the feed?

image

This has only just started either with latest auto-entities or maybe something has changed in the frontend and itā€™s not refreshing a view anymore. If I click on refresh it will disappear immediately.

Iā€™m going to try this but I donā€™t think it will help:

          - type: entities
            entities: 
              - type: custom:auto-entities
                card:
                  type: custom:fold-entity-row
                  head:
                    type: section
                    label: Current Incidents
                  open: true
                filter:
                  include:
                    - entity_id: "geo_location.nsw_fire_service_feed_*"
                    - entity_id: "geo_location.lightning_strike_*"
                  exclude:
                    - state: unknown
                show_empty: true
                sort:
                  method: state

That partly works, but there are a couple of issues:

  1. I get a gap between the cards, which isnā€™t there with vertical-stack-in-card:
    image
    Iā€™ve tried using box-shadow: none and margin: 0 in the style for the inner cards but nothing seems to make the gap go away.
  2. With a big vertical stack (one of mine is 5 cards high) it seems to force everything into one column in the view so cards after the vertical stack card always appear underneath it and never in the column to the right, which means I have to scroll the page to view them.

Do you have any ideas?

Iā€™m trying to use this with graphs.charts andmake them transparent, but it just shows them as white still and doesnā€™t workā€¦
not sure what I am doing wrong as I added via HACS

card_height: 145
style: |
  ha-card {
    background-color: transparent; border: none; box-shadow: none;
  }
entity: sensor.rennas_system_temperature
font_size: 1em
gauge:
  borders: false
  height: 220
  highlights:
    - color: 'rgba(200, 50, 50, .75)'
      from: 80
      to: 100
  majorTicks:
    - '0'
    - '10'
    - '20'
    - '30'
    - '40'
    - '50'
    - '60'
    - '70'
    - '80'
    - '90'
    - '100'
  maxValue: 100
  minValue: 0
  minorTicks: 2
  startAngle: 90
  strokeTicks: true
  ticksAngle: 180
  type: radial-gauge
  valueBox: false
  width: 220
name: Processor (%)
shadow_height: 15%
type: 'custom:canvas-gauge-card'

I also get this error in the log file

2020-01-22 08:29:34 ERROR (MainThread) [frontend.js.latest.201912041] http://x.duckdns.org:8123/lovelace/8:0:0 Uncaught 

Great, that helps :slight_smile: Thanks Thomas!

I canā€™t give you more than the example I provided to Thomas Iā€™m afraid. If that doesnā€™t work for you, that most likely means that youā€™ll need to figure out your structure of the DOM and how to navigate into it.

what I mean is I donā€™t see much styling in the example? is this still what you use:

    - type: custom:slider-entity-row
      entity: light.office
      full_row: true
      #debug_cardmod: true
      style: |
          ha-slider{
            background-color: rgba(0,0,0,0.2);
            border-radius: 15px;
          }

think I overlooked the ha-slider bit.

Turns out thatā€™s a problem with fold-entity-row. Fixed in release 12 of that.

1 Like

Thanks Thomasā€¦ driving me crazy (a short trip here lol)

well, even that doesnā€™t do anything, what on earth am I doing wrong hereā€¦

      - type: custom:button-card
        entity: light.kist
        name: Kist
        icon: mdi:hanger
        size: 40%
        styles:
          card:
            - background-color: rgb(3, 169, 244)
            - box-shadow: none;
            - overflow: unset
          name:
            - color: white
          label:
            - color: yellow
          custom_fields:
            slider:
              - filter: opacity(50%)
          grid:
            - grid-template-areas: '"n" "i" "slider"'
            - grid-template-columns: 1fr
            - grid-template-rows: min-content fr min-content
        custom_fields:
          slider:
            card:
              type: custom:mod-card
              card:
                type: custom:slider-entity-row
                full_row: true
                hide_state: true
                entity: "[[[ return entity.entity_id ]]]"
                style: |
                  ha-slider{
                    color: red
                    background-color: rgba(0,0,0,0.2);
                    border-radius: 15px;
                    margin: 0px;
                    padding: 0px;
                  }
        state:
          - value: 'off'
            styles:
              icon:
                - color: grey
          - value: 'on'
            styles:
              icon:
                - color: yellow
          - value: 'unavailable'
            styles:
              icon:
                - color: red

Other than the - filter: opacity(50%) the slider always looks like:

32

@thomasloven could you see and maybe give me a hint how to change the appearance of the slider?

if I may, you should read the documentation again, thereā€™s several mistakes in your yaml (no ā€˜;ā€™ under styles>card, style under your mod-card not at the good place, you obviously didnā€™t take a look at the DOM of your card, etc.)

of course you may, I asked for it. For help that isā€¦ so please do.

as far as I can see there are no missing ā€˜;ā€™ under styles?

corrected, now following Thomasā€™ instruction

and yes, I am unsure what to style in the slider, hence my request for help.

using this:

      - type: custom:button-card
        entity: light.kist
        name: Kist
        icon: mdi:hanger
        size: 40%
        styles:
          card:
            - background-color: rgb(3, 169, 244)
            - box-shadow: none
            - overflow: unset
          name:
            - color: white
          label:
            - color: yellow
          custom_fields:
            slider:
              - filter: opacity(50%)
          grid:
            - grid-template-areas: '"n" "i" "slider"'
            - grid-template-columns: 1fr
            - grid-template-rows: min-content fr min-content
        custom_fields:
          slider:
            card:
              type: custom:mod-card
              card:
                type: custom:slider-entity-row
                full_row: true
                hide_state: true
                entity: "[[[ return entity.entity_id ]]]"
              style: |
                ha-slider{
                  color: red;
                  background: rgba(0,0,0,0.2);
                  margin: 0px;
                  padding: 0px;
                }

still does exactly nothingā€¦

edit sorted it

@thomasloven Is it possible to add keyframe animation to an auto-entities card with Card-Mod? Iā€™ve successfully added basic styling but effects like the blink demo on your GitHub arenā€™t working for me.

Thanks

Iā€™d guess so, but I canā€™t imagine why youā€™d want to do that.
Itā€™s much better and much much easier to mod the card that youā€™re putting in the card: property of auto-entities.

Sorry I donā€™t follow.

What are you trying to do?
Whatever it is, do it on a normal card first, with fixed entities, without auto-entities.
Then add auto-entities on top of that, without changing anything else, and chances are itā€™ll just work.

Hi Guys,

I am stuck again.

  - cards:
      - card:
          head: sensor.local_ip
          type: 'custom:fold-entity-row'
        filter:
          include:
            - domain: device_tracker
              state: home
        show_empty: true
        sort: name
        type: 'custom:auto-entities'
    title: RĆ©seau
    type: 'custom:vertical-stack-in-card'

I am trying to add a margin-right to the entities listed in the card but canā€™t find how to do so. Any pointer appreciated!


Cheers.

Has anyone had any luck changing the ā€˜thermostatā€™ card ?
The settings page says you can use theme to set a theme, but thatā€™s if your using theme.yaml which I am not

Iā€™ve seen via inspect the following

image

But adding this into my config still gives me the orange slider bar colour

- type: custom:mod-card
  style: |
    ha-card {
      --heat-color:  #ffffff;
    }
    round-slider {
      --round-slider-bar-color:  #ffffff;
    }
  card:
    type: thermostat
    entity: climate.dining_room_thermostat
    name: Nest