Add custom font only to dashboard

I successfully added a custom font to a theme.
Sadly the font only shows up if I select the theme as theme for the whole home assistant frontend. I only want to apply the font to a specific dashboard.

So I select the default theme for HA and inside my dashboard I select the theme that has the font. The theme style gets applied but not the font. Any ideas?

Hi, @skrippi – Did you figure it out? :crossed_fingers:

Sadly not. You having the same problem?

@skrippi Have you tried the HACS add-in called card-mod? I don’t have experience with it, but I’ve seen it referenced in many posts to override styles on dashboards.

Yea, same problem… And it’s really annoying! :sweat:

Had a tiny bit of progress though; I found that the font is displayed on the main page while in edit mode. Also, it always works on subpages/tabs.

Haven’t had time to investigate why, but I thought it should be possible to find the problem by comparing the main page with the subpages.


As for @SlyJester’s suggestion, I make extensive use of card-mod, but really don’t want to declare the font-family a hundred times. And I’m not aware of a way to declare it globally through card-mod? CSS is supposed to be cascading, but – as far as I understand – the shadow-dom approach Home Assistant started using scopes the cascading nature of CSS to a single component…

I was able to do this in HA 2025.5.1 but I had to use the Sections layout and add another line to my theme:

ha-font-family-body: "var(--primary-font-family)"

The font used also needs bo be loaded as a resource, either as a URL to Google Font or a custom fonts.css file that points to an otf or woff file.

Maybe this helps!