#Why are the .card-header in statistics-graph and history-graph not identical?

1 messages · Page 1 of 1 (latest)

next rose
#

hope any of the frontend contributors can see this and maybe explain.
Asking because it is so very unhandy those cards need to be handled differently when using card-mod on them. Going into the shadow roots is not that obvious, and, per these cards, different.
From a user perspective, there would not seem to be a reason, and the cards have the same look and feel.

If there would not be a valid reason, Id rather open a FR to align them.

tall arrow
#

History chart has a button in the header, probably some changes were made to accomodate that.

next rose
#

I do believe the layout difference is from before that. My card_mods have been working reliable since the move to the $: in the card and card_mod. I only noticed because the new (and already retracted) 3.5.0 doesnt properly touch those, and I started experimenting there. Which made me wonder if it wouldnt be feasible to align them from core.

#

the change for the button is a good hint though, Ill try to find that one 😉 thx!

tall arrow
#

Are you familiar with using git blame?

next rose
#

no

#

please instruct 😉

next rose
#

right, so Balloob is to blame haha

tall arrow
#

it just takes you right to the change of a line change

#

good for sleuthing

next rose
#

that is cool though, I always click the history button

#

this makes remember another wish..... we should add the github source to the dashboard cards to their documentation. I find the frontend repo terribly confusing. In core we have that direct link everywhere. In Frontend/Dashboard, when ever I need a source for a card, I need to broswe my way through.....

#

a direct link to eg entities card etc would be awesome. wdyt? FR/Discussion would be worth it?

tall arrow
#

I wonder how helpful that would really be, since the source file for a card may just be some include of other component, and at that point you're lost again.

#

Might be useful in some cases. Github search I imagine could usually get you pretty close.

next rose
#

yeah, but that is a typical response though, not very willing to understand the posters standpoint. for now Ive bookmarked https://github.com/home-assistant/frontend/tree/dev/src/panels/lovelace/cards. it would be helpful if eg https://www.home-assistant.io/dashboards/alarm-panel/ could contain the github link to https://github.com/home-assistant/frontend/blob/dev/src/panels/lovelace/cards/hui-alarm-panel-card.ts etc etc...

Home Assistant

The alarm panel card allows you to arm and disarm your alarm control panel integrations.

GitHub

:lollipop: Frontend for Home Assistant. Contribute to home-assistant/frontend development by creating an account on GitHub.

#

o well off topic in my own topic...

next rose
#

for reference, and resolution here, the card_mod to touch the statistics graph turned out to be:```

card-header statistics-graph

style:
ha-card:
$: |
.card-header {
background: var(--background-color-off);
font-weight: 400 !important;
font-size: 20px !important;
color: var(--text-color-off) !important;
padding: 0px 12px !important;
margin: 0px 0px 16px 0px !important;
}

#

history-graph is with:```

card-header history-graph

class: class-header-margin
style:
ha-card: |
.card-header ha-icon-next {
--card-mod-icon-color: var(--text-color-off);
{{'display: none' if is_state('input_boolean.hide_history_graph_link','on')}};
}

set in class

NOTE this is using card_mod 3.5.0!! so not valid in 3.4.4
:host(.class-header-margin) ha-card .card-header {
background: var(--background-color-off);
color: var(--text-color-off);
font-weight: 400;
font-size: 20px;
padding: 0 12px;
margin: 0 0 16px 0px;
}```

#

quite happy with this end result