Sensor card text cut of with old style layout

When I use the sensor card with the new Sections layout, the text and the graph for the card are displayed over the top of each other, like so:


It’s Awesome!!

_

But when using the old Masonry style layout, the text gets chopped by the graph, like so:


It Sucks!

_

Even with the underlying yaml exactly the same:
(I know I don’t need card_mod: in the Sections layout)

name: Inside Temperature
graph: line
type: sensor
entity: sensor.thermocarry_2
detail: 2
grid_options:
  columns: 15
  rows: 1
card_mod:
  style: |
    ha-card {
      height: 140px !important; # Set a fixed height
    }

Anyone know how I can make the old Masonry style layout have the text over the top of the graph?

I’ve been trying to migrate all my layouts to the new format but I just can’t quite get the layout I like just yet, so some screens are keeping the old type: custom:grid-layout

Sorry, I am not getting, is this code with card-mod was used in Masonry which caused the clipped text? Or you get the clipping without card-mod?

I don’t use card_mod with the Sections layout and it works great, I do use card_mod with the Masonry layout and get the clipping. If I don’t use card_mod then I can’t control the height of the card in Masonry layout.

Changing a card’s height with card-mod may cause undesired effects in many cases. What is a reason of using card-mod in masonry, only to set a smaller height? Cannot test it right now, but I am afraid this card behave differently inside a section; to get same look in masonry you will probably need more styling with card-mod, not just setting a fixed height.

Also, a remark for other people, this is not an “old” type, this is a custom layout-card.

Thanks! Yeah, I only use card_mod to set the height accurately, no other reason. I made these layouts years ago! Do you know a better way to set the height in a Masonry layout?
I’ll look into card_mod again, it’s been a very long time!
Thanks mate!

It seems that it should be done differently for the Sensor card.
Sorry, cannot help right now, away from a PC, may be in a week or two will help. Meanwhile, you can ask in the main card-mod thread, may be someone will help.

1 Like

Feel free to ping me in a week

1 Like

Thanks man!

1 Like

Test this out for your Masonry layout

card_mod:
  style: |
    ha-card {
      height: 140px !important; 
        }
    .info{
      margin-bottom: -90px;
        }

1 Like

Interesting that this clipping happens in masonry… Some research is needed)

Sections applies a fixed footer and Masonry does not. That alters the card’s layout significantly.

class="with-fixed-footer type-entity"

Still playing with it

Good findout. Can these changes be simulated in masonry? Or it turns to be same margin-like way?

Yes if you apply a position:fixed or absolute to .footer {

@LiQuid_cOOled That is working at my end too! Thanks man! :partying_face:

1 Like

@Ildar_Gabdullin jump started my CSS education!

1 Like

THIS post should be marked as a solution then)
@Psyonic

Already did my man!
Thanks for all your help!

Actually, I meant a post with “position”. Playing with margins may not give same results on different clients. Of course, a subject to experiment. Cannot test myself unfortunately.

Oh cool, hope that helps :blush:

1 Like