Skip to content

card-mod support #10

@dcapslock

Description

@dcapslock

Hi, with card-mod v4.x, tailwind-template-card will no longer work due to changes in card-mod which do patch application at the hui-card level rather than ha-card. This means that card-mod is applied to shadowRoot now, which is always replaced with this card. There are other custom cards that also take this approach, but since they are Lit based, card-mod can prepend itself and this still works.

One method to make this card always support card-mod is to apply directly using code like below on render. If this makes sense I can test and submit a PR.

    customElements.whenDefined("card-mod").then(() => {
      (customElements.get("card-mod") as any)?.applyToElement?.(
        this,
        "card",
        this._config.card_mod
        true,
        "type-custom-tailwindcss-template-card"
      );
    });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions