Please see the image below.
While I can use picture-elements for the image itself and sensor values, Iâm playing with idea to draw lines like for odometer. But I donât want to bake those lines into the picture. I would like to plot them over the picture.
There are several methods how to achieve that in html and/or JS. In HA options are rather limited. But with custom button card, I can render any HTML. I succeeded with 1px divs (rotated) as well as with SVG. The result of the latter is seen in the picture. And it seems SVG is easiest way to go.
I figured out those methods (especially using the custom button card) later, after posting to this thread. So answering to not leave your question unanswered.
Now the only issue I have is, that those lines donât scale their position together with responsive size changes. But itâs another -not card-mod related - case.
Can you apply CSS styling to events from a particular calendar entity? Iâd like all events from my âfamily calendarâ to have a unique background-color. The below allows me to set the background color for all events to green.
Just a clarification from my side: What I originally meant was that if you wanted to draw over existing on SVG canvas, that it will be problematic with card-mod, but drawing with SVG wouldâve been possible (at the time of writing, but youâve since got it going).
Thanks.
Thatâs an (unsolvable) problem with the picture elements card Iâve seen many times here, especially from people using it for floorplans. The best you can do is to design for one interface/device, or pick something other than the picture elements card.
I happen to have done the same thing recently due to limitations because of all the UI changes the past few months (not a rant statement, just a fact). Itâs neat, but took some effort. In fact, I wrote the HTML with JS and then still injected styles with card-mod (to keep structure and styling apart, semantically).
Hi all - Iâm using card mod to show a box that contains tasks from Grocy, but only when there are some taks.
The problem is that I want this box to disappear if tasks are more than 3 days away. currently it displays if there are any upcoming tasks.
Any idea how I could do that?
This is my code for the card:
I have issue to change an icon in mushroom template chip. My goal is to create a animation of a spinning fan using css
For simplicity I just changed the icon color to ensure my code is working
Here a color of icons ("âpaper-item-icon-color") MAY BE reassigned to ââsome-variableâ if it is defined.
Imagine that user-defined ââsome-variableâ is defined in a custom theme - then icons will have this ââsome-variableâ color if this theme selected. If a default theme is used (or this variable is not defined in the selected theme) - then a default ââpaper-item-icon-colorâ is used.
Unfortunately this code does not work - as well as this:
ha-card {
{% set COLOR = 'var(--paper-item-icon-color)' %}
--paper-item-icon-color: var(--some-variable, {{COLOR}});
}
Seems that a kind of loop occurs here - i.e. code is NOT executed line-by-line.
The only working solution is using an explicit value instead of variable (which is not flexible as it could be):
Hello, I am trying to put some CSS using card-mod into two custom cards combined within each other.
The custom cards are:
button card (the templated one that minimalist ui offers)
swipe card
My issue is that the button card being inside the swipe card does not allow me to swipe as the container of elements inside the button-card is almost as big as the swipe area. To avoid double-posting my issue can be seen here in the swipe thread: Lovelace: Swiper card - #625 by elementoulis
I ended up realizing that card-mod could help me shrink down the container of elements allowing me some more âun-tappableâ room for my finger to swipe. But for the love of God I canât figure out how to target it properly. Iâve discovered that I need to introduce some padding-right: 70px; as seen in the picture below.
I have an issue since a few weeks where the background of a card doesnât load occassionally. It issue occurs maybe 25% of the times on my phone and 90% of the times on my laptop.
This is only an issue on the first lovelace tab and the content of the card doesnât matter, same layout on other cards but they work fine. Changing the order of the tabs still causes the issue only on the first tab. I have simplified it to a markdown card with just a table and the word âTestâ and I still get the issue. Hitting Ctrl-F5 solves the issue always.
I donât know if this would improve the situation, but why do you set the variable there and not directly the background? At least, this is one assignment iteration, which can be reduced. And secondly (as workaround), you can apply themes per card as well, if the problem will not be solved, where you can overwrite.as well.
You are assigning your color to the variable --ha-card-background. So here you donât set the color of the background, but only the variable, which is then only applied in a second step to the background. Possible as well:
Hey guys,
I am struggling with changing the borders of my card as well as animate the icon at the same time. I have tried various combinations of code I found in this thread but as I do not understand how the structure works I cannot find a solution. I only found examples for one or the other. When I copy everything from the example page below, I can get the icon to move. However, the corners do not line up, the background color doesnât get applied and the border does not show up either.
My goal is to animate the trash can as well as change the color depending on the stat_attr of the calendar. Last but not least everything should fit together nicely. Which I donât know how to do.
I do not know how to differentiate between ha_card and ha-icon. So it is possible the current version doesnât make any kind of sense to someone who knows what they are doing.
Iâd appreciate any kind of help. Thank you.
edit: I also found the page where the is a code example for the animations. But that leads me to the same problem that I do not know how to put it into my existing code.
Thanks for looking into this, and I see your point which makes sense. I changed the code but unfortunetely the inconcistant behaviour continues.
Edit:
Just realized that this is not background specific but affects all cards in the first tab. A simple text card with a different font is not loaded properly either. As always, a Ctrl-F5 fixes the issue temporarily.
Am I the only one with this issue? Nothing has changed in my code, this started happening a few weeks ago. Have no clue where to start looking or debugging.