Card-mod only working in preview - solved!

Together with Claude I started using card-mod yesterday with only partial success..

All changes I made will be displayed in preview of the gui correctly, but after saving the changes it went back to dashboard without card-mod.

Claude asked me to check everything that could be the cause but without any success.

Home-assistant and card-mod are on actual version.

Someone has an idea what could be the cause?

Not without seeing your attempted config. We are terrible mind readers.

You should forget card-mod and use uix:

Ok. Even this little piece of code is only working in preview…

type: markdown
content: card_mod Test
card_mod:
style: |
ha-card {
background: red !important;
}

As suggested by @Sonikky UIX is the way to go.

card_mod not showing is a symptom of incorrect resource URL. This point in itself was the original impetus to create UIX. UIX as an integration manages resource URL for you. Plus lots of feautures not in card_mod. Check the FAQ.

Your config works for me:

Likely you have an indentation issue but I can’t see that because you did not format your post correctly for the forum

type: markdown
content: card_mod Test
card_mod:
  style: |
    ha-card {
      background: red !important;
    }

There’s no need to use UIX. Card-mod works fine.

So the syntax is ok.
I‘ve tried the same with uix right now and it is not working either..
With uix even the preview is not working..
So what could be wrong on my system?

Just checked the url.
Everything is fine.

I got it running…

I‘ve checked my configuration.yaml and together with Claude I found 2 entries that might be the cause of my problem…

I think these could be part of an old integration that I’m no longer using for a long time.

After removing card-mod is working as expected.

Thanks for your help.