-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sometimes card border shown, sometimes it doesn't #150
Comments
Same thing happening to me here. |
So I just noticed this is only happening on the very first page of my dashboard. The other pages render just fine, but if I refresh any of them it renders borders and border radius again. Very weird. |
I have this issue as well. |
I'm having this issue as well, but for me, it's only appearing on my mobile device while using the HA app for iOS. Pulling down to refresh the page doesn't fix it, but making any arbitrary edit to the card and then saving it fixes the issue until I reopen the app. |
Yeah I was deleting spaces at the end of the yaml, then saving because it drives me nuts lol. |
If anyone is using card_mod HACs integration inside the Since I'm seeing this issue in the iOS app, I figured the issue would show up in Safari, and it did. After inspecting the DOM, I found out that adding Here's a simplified version of my card: type: custom:vertical-stack-in-card
cards:
- type: entities
entities:
- entity: timer.timer2
card_mod:
style: # vvv This fixed the border issue for this card
.: |
ha-card { border: none; }
# ... Not sure why Safari/iOS needs this fix for it to render properly when the Brave browser works just fine without it. |
I tried this and it no luck for me when I added it to the 2nd horizontal stack in my original post. type: custom:vertical-stack-in-card
cards:
- type: horizontal-stack
cards:
- type: custom:mushroom-title-card
title: Living Room
- type: horizontal-stack
card_mod:
style:
.: |
ha-card { border: none; }
cards:
- type: custom:mushroom-template-card
primary: Lights
icon: mdi:lightbulb-group-off
entity: light.group_upstairs_lights_living_area
tap_action: ....
layout: vertical
... It still works fine on my chrome browser / desktop, but in the app on my iphone it doesn't help. |
Seems like a lot of us are having this same issue. I wonder what happened with the code. |
@smenzer Do you have access to a Safari browser? If you do, you'll be able to figure out the exact element that needs Also, did you try moving the For example: type: custom:vertical-stack-in-card
cards:
- type: horizontal-stack
cards:
- type: custom:mushroom-title-card
title: Living Room
- type: horizontal-stack
cards:
- type: custom:mushroom-template-card
primary: Lights
icon: mdi:lightbulb-group-off
entity: light.group_upstairs_lights_living_area
tap_action: ....
layout: vertical
card_mod: # <---- Put it here and see if the border for the light.group_upstairs_lights_living_area card disappears.
style:
.: |
ha-card { border: none; }
... |
I do, I’ll play with it tonight to see what’s going on.
|
So I tried adjusting the Note - I also get this incorrect behavior in Chrome, so this isn't just a Safari issue. |
It's for sure not just on Safari, It is happening on my Android phone and Brave browser. I noticed that the code is sometimes there and sometimes not there like you said too. |
Any luck? |
the element that the border is set on seems to be the applying the what's so strange, though, is that it works sometimes at the horizontal stack level: all i did was refresh the page and sometimes it works - in this instance above, you can see that the so, in summary - applying the |
I just might found the solution for this: use card mod themes. Stacked_Cards:
card-mod-theme: Stacked_Cards
card-mod-card: |
ha-card.type-custom-vertical-stack-in-card {
border: none;
} More info on how to use it: https://github.com/thomasloven/lovelace-card-mod/wiki/Card-mod-Themes I recently added this in a custom theme file and all borders are gone without having to add this style to every card. If you are already using a theme you can just simply add this to it. edit: for using with mushroom, the corresponding css class has to be used, e.g. Stacked_Cards:
card-mod-theme: Stacked_Cards
card-mod-card: |
ha-card.type-custom-mushroom-template-card {
border: none;
}
:host {
border: none;
} |
Hello again, Stacked_Cards:
card-mod-theme: Stacked_Cards
card-mod-card: |
/* container elements (consume the style) */
ha-card.type-tile {
border-width: var(--stacked-border-width, 1px);
}
/* container (define the style) */
ha-card.type-custom-vertical-stack-in-card {
--stacked-border-width: 0px;
}
/* extra classes - use in card yaml:
card_mod:
class: no-border no-bg
*/
ha-card.no-border {
box-shadow: none;
border: 0px;
border-radius: 0;
}
ha-card.no-bg {
background: transparent;
} All elements (e.g. tile cards) in a container like the vertical stack card are getting a style which uses a css variable. The trick is to set the variable only for the container. So only tile cards within a vertical stack card are styled and have no borders. All other tile cards, somewhere in the view outside our container, are kepping its borders. So you have to define this for every "container" you are using. No matter if this is a horizontal stack or Thomas Loven's layout card. And you have to define this for every card-type you are using ins such containers. In my example every tile card in vertical stacks is covered. At last i defined some extra classes which can be assigned for single use e.g. when you are using a card only once inside a container and you do not want to write a rule for that card-type. You can combine these classes and decide per card if it should have only no border or no background too. Or you define what else you need. In fact this makes the For further inspiration on how to use card mod themes have a look at the corresponding thread, especially this post |
+1. This is still an issue in the latest version. It seems to specifically be a problem with the vertical-stack element. |
Thanks!! This did it for me where borders would show up after every refresh on both Windows and Android :D |
this is mycode |
This is a bit of a weird one.... I'm using a vertical stack in card with two horizontal stacks inside. Sometimes when I load the dashboard (could be on mobile app, my laptop via the web, etc) I see borders between the cards in the horizontal stack. If I refresh the page, the borders go away. Sometimes I open it back up and the borders are there again. I don't want the borders to appear, but I can't figure out how to consistently keep them away.
Here's a screenshot of me opening the same dashboard twice in a row, once where the borders appeared and once where it didn't.
As you can see, on the right side where it appears the way I want, there are styles added directly to the
<mushroom-template-card>
and<ha-card>
to remove the border. I'm not using card-mod or anything like that, so I don't know why these appear sometimes and not others. Below is the yaml code for the Living Room card (w/some details removed to make it easier to read):I've been reading that I can use card-mod to remove the borders...which I might do. Bit I wanted to share since this seems like a bug, and I'd rather avoid adding a bunch of card-mods if I can avoid it.
Thanks!
The text was updated successfully, but these errors were encountered: