🔹 Card-mod - Add css styles to any lovelace card

If someone missing secondary_info: last-changed for input_select entity-row (sadly it is not available out-of-box):

Update (21.06.22): the post is updated with styles for MDC controls; old style (see at the bottom of the post) does not work since 2022.3.

image

Code
  - entity: input_select.test_value
    card_mod:
      style: |
        ha-select::after {
          content: "{{relative_time(states[config.entity].last_changed)}} ago";
          font-size: var(--paper-font-caption_-_font-size);
          color: var(--secondary-text-color);
          padding-left: 12px;
        }
Old style - not valid since HA 2022.3

image

  - entity: input_select.test_value
    name: some name
    icon: mdi:weather-night
    card_mod:
      style:
        ha-paper-dropdown-menu:
          $:
            paper-menu-button:
              .dropdown-trigger:
                paper-input:
                  $:
                    paper-input-container:
                      $: |
                        .underline::after {
                          content: "{{relative_time(states[config.entity].last_changed)}} ago";
                          font-size: var(--paper-font-caption_-_font-size);
                          color: var(--secondary-text-color);
                        }
                      .: |
                        paper-input-container {
                          padding-bottom: 20px;
                        }

Also, any text may be added:

image

Code
  - entity: input_select.test_value
    card_mod:
      style: |
        ha-select::after {
          content: "Sun: {{states('sun.sun')}}";
          font-size: var(--paper-font-caption_-_font-size);
          color: magenta;
          padding-left: 12px;
        }
  - entity: input_select.test_value
    card_mod:
      style: |
        ha-select::after {
          content: "Sun: {{states('sun.sun')}}\A Elvn: {{state_attr('sun.sun','elevation')}}";
          font-size: var(--paper-font-caption_-_font-size);
          color: magenta;
          padding-left: 12px;
          display: block;
          white-space: pre;
        }