Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/components/ha-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,22 @@ class HaCard extends LitElement {
display: block;
transition: all 0.3s ease-out;
}
.header:not(:empty) {
font-size: 24px;
.header:not(:empty),
.header::slotted(*) {
color: var(--ha-card-header-color, --primary-text-color);
font-family: var(--ha-card-header-font-family, inherit);
font-size: var(--ha-card-header-font-size, 24px);
letter-spacing: -0.012em;
line-height: 32px;
opacity: 0.87;
padding: 24px 16px 16px;
display: block;
}
`;
}

protected render(): TemplateResult {
return html`
<div class="header">${this.header}</div>
<slot class="header" name="header">${this.header}</slot>
<slot></slot>
`;
}
Expand Down
24 changes: 4 additions & 20 deletions src/panels/lovelace/cards/hui-entities-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class HuiEntitiesCard extends LitElement implements LovelaceCard {
${!title && !show_header_toggle
? html``
: html`
<div class="header">
<div class="header" slot="header">
<div class="name">${title}</div>
${show_header_toggle === false
? html``
Expand All @@ -114,12 +114,8 @@ class HuiEntitiesCard extends LitElement implements LovelaceCard {

static get styles(): CSSResult {
return css`
ha-card {
padding: 16px;
}

#states {
margin: -4px 0;
padding: 12px 16px;
}

#states > * {
Expand All @@ -131,28 +127,16 @@ class HuiEntitiesCard extends LitElement implements LovelaceCard {
}

.header {
/* start paper-font-headline style */
font-family: "Roboto", "Noto", sans-serif;
-webkit-font-smoothing: antialiased; /* OS X subpixel AA bleed bug */
text-rendering: optimizeLegibility;
font-size: 24px;
font-weight: 400;
letter-spacing: -0.012em;
/* end paper-font-headline style */

line-height: 40px;
color: var(--primary-text-color);
padding: 4px 0 12px;
margin-bottom: -8px;
padding-bottom: 0px;
display: flex;
justify-content: space-between;
}

.header .name {
/* start paper-font-common-nowrap style */
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
/* end paper-font-common-nowrap */
}

.state-card-dialog {
Expand Down