Closed SteffenM-DE closed 1 year ago
Hi @SteffenM-DE
card_mod:
style: |
ha-card .card-header {
font-size: 1rem;
padding: 0 1rem;
}
Here is the result:
If yes, you can style it with card mod by adding this:
card_mod:
style: |
.item-content .duration {
display: block;
float: none;
}
Hi,
thank you for the comments and the solutions with Card-mod.
The point with line break I try to describe a little bit more:
I using a template to build a string from differnet entitiys and attributes, so I have a longer string in the template state. If I use this entity the state is showing at the main row of your sample it is 'Sous l'horizon'. If it is very long your card using two lines but breaks the line anywhere. With the manuel line break like other crads (Mushroom) I can make the line break on a special position.
I hope now it's clear whats my wish abaout.
Thanks.
Can you provide me a screenshot ? How do you achieve that with mushrooms cards for example ?
In Mushroom we can have a "\n" in a state and this is a line break so we can create a line break on a special position:
In the scrennshot you can see your card and my long state coming from a template starting with 'Eingehnd'. The first row have no line break but the second have after the arrow showing the called number. So if I creat the tempate state for the logbook entity I want to add a line break (\n) to have always a line break bevor the arrow. So all rows show the same construction.
I hope now it's clear. Thank you very much.
Can you show how do you do to have multiline state ...
I tried but did not succeed to have it working ...
With this configuration
template:
- sensor:
- name: "test"
unique_id: "9a00a4af-5319-4208-a72e-cdb33622c7f3"
state: >-
{{ "Multi \n
line
text" }}
{{ "2" }}
I got this ...
Can you test using this configuration ?
card_mod:
style: |
.state {
white-space: pre-wrap;
}
If it is working i'll add as default style for the card
white-space: pre-wrap; did not work complet. I can add \n but sometimes it breaks the line if there is no \n and no reason to must break the line.
So I think Mushroom translate the \n to a linebreak so the user can decide where to break the line. Here is the example:
Can you show me what it render on the logbook card and what you expect?
Like the Mushroom scrennshot, I add \n in the template state and I want to render it as fixed line break inside the state.
Logbook look like that:
But I have add a \n befor the small arrow to have a line break at this position, that it looks this way. Because if there are numbers the line a longer and breaks on a ugly place ansd so I have a uniformly view with always a lin breka befor the target is shown:
Unbekannt ► Geschäft
Thank you, is working now.
Hi,
great work for showing nice history of an entity.
I have some point with enhacemends if you like:
Thanks you, Steffen