🔄 Simple Swipe Card - A Custom Card for Easy Card Navigation

Now I got it. If I go back with card-mod to latest release 4.1.0 everything is fine:

If card-mod is on one the 4.2.0 Beta card is postponed:

But only in combination with simple-swipe-card although no card mod is used in this card consisting of three bubble cards?

Bug report is created.

As per info placed in bug report in simple-swipe-card and card-mod issue, bubble-card may need auto prepend (new 4.2.0 feature) due to how bubble-card renders and how Lit framework may then remove card-mod. As bubble-card uses ha-card but not wrapped by hui-card, card-mod is prepended in ha-card light dom. This then makes the bubble-card content get negative margin as it is no longer the first child. See issue link for more details.

A theme based workaround is included in the card-mod issue. As to how to have card-mod fix in code… I will need to consider how this is best done.

OK, thank you. I hope you find a way to do this :wink:

Just to be clear and to be on the safe side: I didn’t use card-mod or prepend in this card, so I didn’t think of card-mod as the cause at first …

If you have card-mod intstalled it will always add to the DOM as an element so it can respond to new themes which may have card-mod elemenets. In 4.2.0 prepend is automatic when needed as otherwise styling cards that need it, that you can’t add config to directly (e.g. energy cards on built in energy dashboard), would not be able to be styled as you can’t set prepend in any config.

I have submitted a Frontend PR to only check for .card-content being first of cards with class .card-header and .card-content, which is really what the :not(:first-child) of current ha-card is checking for. If accepted then next HA release will be compatible with 4.2.0(-beta).

EDIT: Frontend PR has been accepted so once the PR makes it to a release there will be no problems with 4.2.0 and bubble-card in simple-swipe-card. If the PR does not make it into a 2026.1.x release then it will be in 2026.2

1 Like