Update cookcli-card.js

This commit is contained in:
TheThomaas 2026-09-24 16:24:25 +02:00
parent 9e33d3c7df
commit 3534fbcccf

View file

@ -645,6 +645,7 @@ class CookCliCardEditor extends HTMLElement {
* type: custom:cookcli-checklist-card * type: custom:cookcli-checklist-card
* storage_key: chocolat-chaud.cook:2 * storage_key: chocolat-chaud.cook:2
* items: [{ quantity: "200 ml", name: "lait" }, ...] * items: [{ quantity: "200 ml", name: "lait" }, ...]
* title: Ingrédients # optionnel
*/ */
class CookCliChecklistCard extends HTMLElement { class CookCliChecklistCard extends HTMLElement {
setConfig(config) { setConfig(config) {
@ -739,6 +740,13 @@ class CookCliChecklistCard extends HTMLElement {
this.shadowRoot.innerHTML = ` this.shadowRoot.innerHTML = `
<style> <style>
ha-card { padding: 8px 16px; } ha-card { padding: 8px 16px; }
.title {
padding: 8px 0 4px;
font-size: var(--ha-card-header-font-size, 24px);
font-weight: var(--ha-card-header-font-weight, 400);
line-height: 32px;
color: var(--ha-card-header-color, var(--primary-text-color));
}
.row { .row {
display: flex; display: flex;
align-items: center; align-items: center;
@ -771,6 +779,7 @@ class CookCliChecklistCard extends HTMLElement {
} }
</style> </style>
<ha-card> <ha-card>
${this._config.title ? `<div class="title">${this._escape(this._config.title)}</div>` : ""}
${rows} ${rows}
<button class="reset" data-reset>Tout décocher</button> <button class="reset" data-reset>Tout décocher</button>
</ha-card> </ha-card>