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

I think conditional entity rows add a Shadow DOM layer above hui-generic-entity-row, which will vary according to the type of entity.

If Iā€™m right, you should be able to see this with the DOM inspector.

1 Like

If you mean standard HA theme variables - check here.
If you are looking for a good CSS tutorial - check here.

Do you mean a conditional row inside Entities row?
They should be styled on a higher level.
As usual, 1st post ā†’ ā€¦ ā†’ conditional rows

right, I did try this šŸ”¹ Card-mod - Add css styles to any lovelace card - #1845 by Ildar_Gabdullin

        - type: conditional
          conditions:
            - entity: sensor.radio_players_playing
              state: '0'
            - entity: sensor.activated_media_players #group.media_players_active
              state_not: '0'
          row:
            entity: script.play_radio
            action_name: Speel
          card_mod:
            style:
              hui-simple-entity-row$: |
                hui-generic-entity-row {
                  text-indent: 45px;
                  color: red;
                }

but that does not get applied either. Itā€™s a direct c&p accept I added card_mod:

I mean a step by step to troubleshoot via Browser Developer Mode :slight_smile:

???

type: entities
entities:
  - input_boolean.test_boolean
  - type: conditional
    conditions:
      - entity: input_boolean.test_boolean
        state: 'on'
    row:
      entity: script.test_script
      action_name: xxxxx
    card_mod:
      style:
        hui-script-entity-row $: |
          hui-generic-entity-row {
            text-indent: 45px;
            color: red;
          }
1 Like

have no idea is there any ready tutorialā€¦

arghh, missed that script-entity-rowā€¦ my bad:

          card_mod:
            style:
              hui-script-entity-row $:
                hui-generic-entity-row:
                  $: |
                    state-badge {
                      color: var(--ok-color);
                    }

this now works and colorizes the icon

Hi all,

Iā€™ve spent hours trying to change the height of the modes buttons (and will do the same for fan speed buttons).

Value should be ā€“control-select-thickness: 100px; (changed from 40px)

This is what Iā€™ve tried with card-mod:

card_mod:
  style:
    hui-card-features $ hui-climate-fan-modes-card-feature $: |
      ha-control-select {--control-select-thickness: 100px; }

Where do I go wrong about this??

you have different - ā€œhvacā€ on s screenshot & ā€œfanā€ in a code

yes, that is a terrible nuisance, having to create those mods for all individual domains cardsā€¦
I had that figured out here How to set border-radius on Tile card Features

@TheStigh maybe it helps you somewhat

edit

my bad, sorry. only noticed the card-featuresā€¦ not that you dont have the Tile card thereā€¦ sorry

Nailed it (!!!), thanks to a post from @arganto šŸ”¹ Card-mod - Add css styles to any lovelace card - #6493 by arganto

Damn, this was a tricky oneā€¦

Solution:

card_mod:
  style:
    hui-card-features:
      $:
        hui-climate-hvac-modes-card-feature:
          $:
            ha-control-select:
              $: >
                :host {
                  --control-select-thickness: 100px !important;
                }
        hui-climate-fan-modes-card-feature:
          $:
            ha-control-select:
              $: >
                :host {
                  --control-select-thickness: 100px !important;
                }

I think the GUI editor doesnā€™t like the "!include ā€¦ ", too bad

correct, cant use include in UI.


Iā€™ve been able to stumble my way through modifying the custom:mini-media-player card so far but Iā€™m having trouble figuring out how to move these buttons up a little bit? and bonus if someone can help me put a little padding around them too that would be great!

Hereā€™s my current card mod:

card_mod:
  style: |
    ha-card {
      height: 200%;
      position: relative;
      max-width: 100%;
      --mmp-unit: 1.5 !important;
      --mdc-icon-size: 50px  !important;
    }
    .entity__info__media {
      font-size: 50px;
      position: relative;
      top: -5px;
      }

    .mmp-player__core { 
      height: 75px;
      top: -75px;
      }
    .entity__info__name {
      position: relative;
      top: -20px;
      }
    .entity__icon {
      position: relative;
      top: -80px;
      }

Bump, hoping someone has the right clue :bulb:

I bet it is sooooo easyā€¦ :frowning:

did you completely check šŸ”¹ Card-mod - Add css styles to any lovelace card - #1188 by Ildar_Gabdullin

please post a single entities card with that entity and show what you tried to do

Hey,
can someone give me a short tip how to create the icon color depending on window state. (open/close/tilt)
I found several of topics regarind that issue, but honestly IĀ“m not well know in programming and nothing works.

What IĀ“ve already done:
create template.yaml to display the correct state of the window:

  - name: "Fenster KĆ¼che EG"
    state: >
      {% if is_state('binary_sensor.fenster_kuche_eg_offen', 'off') and is_state('binary_sensor.fenster_kuche_eg_gekippt', 'off') %}  
      offen
      {% elif is_state('binary_sensor.fenster_kuche_eg_offen', 'on') and is_state('binary_sensor.fenster_kuche_eg_gekippt', 'off') %}  
      geschlossen
      {% else %}
      gekippt
      {% endif %}

    icon: >
      {% if is_state('binary_sensor.fenster_kuche_eg_offen', 'off') and is_state('binary_sensor.fenster_kuche_eg_gekippt', 'off') %}  
      mdi:window-open-variant
      {% elif is_state('binary_sensor.fenster_kuche_eg_offen', 'on') and is_state('binary_sensor.fenster_kuche_eg_gekippt', 'off') %}  
      mdi:window-closed-variant
      {% else %}
      mdi:window-open-variant
      {% endif %}

this works well.

what I wuold like to get:
Icon color red: open
Icon color orange: tilt
Icon color green: closed (Hide this state in the Dash Overview)

May I add this in the template.yaml or in the tile card config?

Thanks for helping me.

for anyone that cares the answer to this its

    .mmp-player__adds {
      position: relative;
      top: -70px;  # Move the container of media control and volume buttons up
    }

sure, go to the top post, check the link at the bottom, and look for entities card_mod, that is to say, if yuio want this entity in an entities card.

other than that, you should provide some info for us to be able to help you