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

Some (useless?) styles for history-graph - Styling a tooltip
WARNING: not working after 2025.2.

code
  - type: history-graph
    entities:
      - entity: sun.sun
    card_mod:
      style:
        state-history-charts $:
          div :first-child $:
            ha-chart-base $: |
              .chart-tooltip {
                background: lightgreen !important;
              }
              .chart-tooltip .title {
                color: red;
              }
              .chart-tooltip .before-body {
                color: magenta;
              }
              .chart-tooltip li {
                color: yellow;
              }

code
  - type: history-graph
    entities:
      - entity: person.ildar
    card_mod:
      style:
        state-history-charts $:
          div :first-child $:
            ha-chart-base $: |
              .chart-tooltip .before-body:after {
                content: "";
                background-image: url("/local/images/persons/ildar.png");
                background-position: center;
                background-repeat: no-repeat;
                background-size: contain;
                height: 100px;
                display: block;
              }

Note that you may place a more useful picture instead of my photo here - like a generated route “from A to B”, or a position of a person on a map ! (update: no, it is not great to show the LATEST state instead of a state for a particular time… So, we may show only same image for all time points… )

1 Like