2022.11: Card borders

If you never use themes it is enough to follow the steps described here:
Defining Themes


# Example configuration.yaml entry
frontend:
  themes:
    No Borders:
      ha-card-border-radius: 1px ## or whatever radius you want
      ha-card-border-color: rgba(0,0,0,0) ## transparent


6 Likes

Fo those dissappointed with new card borders; you can restore previous look using these theme variables:

  ha-card-border-width: "0px"         # controls the width of border, set to 0 to remove
  ha-card-border-color: "#xxyyzz"     # controls the color of the border line, set to card background color to blend with card

Either of above will visually remove border line.

6 Likes

I really dislike the new UI it broke my dashboard added borders and made cards look like balloons is there any way to revert to previous theme please?

5 Likes

There is an even better way to get rid of borders. The following needs the card-mod addon to work. It only removes boarders from the lovelace view, so for example the integration page looks normal.

In your theme config:

your-theme-name:
  card-mod-theme: your-theme-name
  card-mod-root-yaml: |
    .: |
      ha-app-layout {
        --ha-card-border-width: 0px;
      }

Dark mode

1 Like

Hi, this is great, is there any way to make it the default dark theme? Using

  no-borders:
    card-mod-theme: no-borders
    card-mod-root-yaml: |
      .: |
        ha-app-layout {
          --ha-card-border-width: 0px;
          --ha-card-border-radius: 1px
        }

removes the borders, but turns the theme light. Thanks for any suggestion!

I’ve created a theme based on @Frenck’s “outline” theme - which he has set to depricated…

It just follows the default theme from HomeAssistant (as he’s did) - but does now have edged cornors for the cards…

GitHub - ChristophCaina/home-assistant-theme-outline-edge: 🎨 Home Assistant Theme: Outline

I’m still trying to figure out how to “publish” it to HACS… - of course, if Frenck would agree with it… ?!

1 Like

Try:

no-borders:
  modes:
    dark:
      # I think there must be at least one setting here to get this to work, try for example
      text-color: '#ffffff'
  card-mod-theme: no-borders
  card-mod-root-yaml: |
    .: |
      ha-app-layout {
        --ha-card-border-width: 0px;
        --ha-card-border-radius: 1px
      }
2 Likes

I agree.
But that should be for those - who want to have the “default” theme - just without the round borders… similar as it was with the original “outline” theme from @frenck :wink:

Afaik, you can’t add these two lines to a theme that does not appear in the “themes” folder?

there is no such thing.

you either dont have themes configured (and by default use only the ‘default’ theme), or you do have themes configured.

if the former, you can use the new edits by creating a first smal theme, with only those lines. And select that theme in the selector. (you can not add anything to the ‘default’ theme)

if the latter, add it to any/all themes and continue like before.

easily done with a yaml anchor on the top theme in your file:

  <<: &generic
    ha-card-border-radius: 0px
    ha-card-border-width: 0px
    any other stuff you want in all other themes

and inject in all below themes in the file:

  <<: *generic

that’s what I did - and that’s what I would like to share on HACS for those who don’t want to use one of the many themes because they still like the color-theme from the default installation - but don’t want to have rounded cards :wink:

so - basically - just a “default” theme without “radius”
grafik

Still trying to figure out how to do the switch between dark / light mode… since this does not seem to work in the “Set theme” service…

that’s not how that works either…

frontend.set_theme does what is says, set a theme.

In a theme you can have specifics for light and dark_mode. If not, again, it follows the settings for default
dark/light mode follow the mode your device is in.

however, you can set themes, and not configure those dark/light modes at all. I dont use them, and dont use dark mode either. Eg I switch to dark themes on certain occasions (below horizon/away) or red theme (alarm triggered…)

So depending in your wishes, you can customize away

you can see here frontend/ha-style.ts at c810c67a539f16f250d30f755832ebd9ad990707 · home-assistant/frontend · GitHub and here frontend/styles.ts at c810c67a539f16f250d30f755832ebd9ad990707 · home-assistant/frontend · GitHub what the default settings are

yes. but even if I do have modes for dark and light, it seems that the service can’t set them.

example?
I do have a google theme… that does have the following modes:

this is the setting in the service:

Executing “call service”

User Setting is “Backend Selected”
grafik

→ no change.

The same user-Settings, the same theme → Light mode selected:

executing “call service”

the theme will be changed… but only the light mode is available.

I can ONLY change the mode within the User settings:
grafik

So in my eyes, the “Mode” selection in the service seems not to work?!
And the theme selection itself does ONLY work, when light mode has been selected.

maybe move this to a separate thread as it is not about the release, but about the more generic theme workings.
it would also give you some more playground and experiment with Home Assistant Frontend - Home Assistant

EDIT: I went this route instead and also added a resource in the browser instead (the companion app doesn’t want to load new modules that way without a wipe).

Frenck’s theme is released under the MIT license, so your question is answererd

I would argue the same about running non-HA containers on docker when running Supervised.

That’s the ticket!

no-borders:
  modes:
    dark:
      text-color: '#ffffff'
  card-mod-theme: no-borders
  card-mod-root-yaml: |
    .: |
      ha-app-layout {
        --ha-card-border-width: 0px;
        --ha-card-border-radius: 1px
      }

finally gives me back my old dashboard :heart_eyes:
image

instead of this :frowning:
image

Many thanks for your advice!

1 Like

So we know how to fix borders and their radius. What about shadows?
Or maybe generally there is a link with the list of HA CSS identifiers?

are you using the HomeAssistant default theme? or any other theme?

1 Like

Do you understand that any attempts of fixing a design by themes is a WRONG way?
Wrong - at least because not all results depend on a value of some variable.