+
+
+ ${badges.map(
+ (badge) => html`
+
+ ${badge.iconSlot} ${badge.slot}
+
+ `
+ )}
+
+
+
+ `
+ )}
+ `;
+ }
+
+ firstUpdated(changedProps) {
+ super.firstUpdated(changedProps);
+ applyThemesOnElement(
+ this.shadowRoot!.querySelector(".dark"),
+ {
+ default_theme: "default",
+ default_dark_theme: "default",
+ themes: {},
+ darkMode: true,
+ theme: "default",
+ },
+ undefined,
+ undefined,
+ true
+ );
+ }
+
+ static styles = css`
+ :host {
+ display: flex;
+ justify-content: center;
+ }
+ .dark,
+ .light {
+ display: block;
+ background-color: var(--primary-background-color);
+ padding: 0 50px;
+ }
+ ha-card {
+ margin: 24px auto;
+ }
+ .card-content {
+ display: flex;
+ gap: 24px;
+ }
+ `;
+}
+
+declare global {
+ interface HTMLElementTagNameMap {
+ "demo-components-ha-badge": DemoHaBadge;
+ }
+}
diff --git a/src/components/ha-badge.ts b/src/components/ha-badge.ts
index b4644921d5..95bee281f4 100644
--- a/src/components/ha-badge.ts
+++ b/src/components/ha-badge.ts
@@ -103,7 +103,7 @@ export class HaBadge extends LitElement {
color: var(--secondary-text-color);
}
.content {
- font-size: var(--ha-font-size-badge, var(--ha-font-size-s));
+ font-size: var(--ha-badge-font-size, var(--ha-font-size-s));
font-style: normal;
font-weight: 500;
line-height: 16px;
@@ -111,7 +111,7 @@ export class HaBadge extends LitElement {
color: var(--primary-text-color);
}
::slotted([slot="icon"]) {
- --mdc-icon-size: var(--ha-icon-size-badge, 18px);
+ --mdc-icon-size: var(--ha-badge-icon-size, 18px);
color: var(--badge-color);
line-height: 0;
margin-left: -4px;