Skip to content

Commit b67d3a8

Browse files
committed
Reduce cover title size and allow to change the title of the card
1 parent ee55f39 commit b67d3a8

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

hass-cover-card.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@ class CustomCoverCard extends HTMLElement {
66
//Init the card
77
if (!this.card) {
88
const card = document.createElement('ha-card');
9-
card.header = 'Cover card';
9+
10+
if (this.config.title) {
11+
card.header = this.config.title;
12+
} else {
13+
card.header = 'Cover card';
14+
}
15+
1016
this.card = card;
1117
this.appendChild(card);
1218

@@ -129,7 +135,7 @@ class CustomCoverCard extends HTMLElement {
129135
.cc-covers { padding: 16px; }
130136
.cc-cover { display: flex; margin: 1rem 0; }
131137
.cc-cover-left { flex: 1; }
132-
.cc-cover-label { font-size: 24px }
138+
.cc-cover-label { font-size: 20px; }
133139
.cc-cover-buttons { text-align: center; margin-top: 2rem; }
134140
.cc-cover-right { flex: 1; }
135141
.cc-cover-selector-picture { position: relative; margin: auto; background-size: cover; min-height: 150px; max-height: 100%; width: 153px; }
@@ -204,6 +210,7 @@ class CustomCoverCard extends HTMLElement {
204210
if (!config.entities) {
205211
throw new Error('You need to define entities');
206212
}
213+
207214
this.config = config;
208215
this.maxPosition = 137;
209216
this.minPosition = 19;

0 commit comments

Comments
 (0)