I won’t to change icon colour based on status of two sensors.
If one of my windows is open then I want gold colour else colour must be steelblue
Does not work as expected.
Can you please check my code:
I am trying to set font size of the “kitchen” part of this card. But i am struggling a bit. The color and background and weight settings work, but not the font size. I am also not sure when to use ha-card vs :host? On a related note, can i set the background color as a rgb code, or take from the time, or does it have to be a “named color”?
I don’t know enough about car-mod to know when host is right and ha-card is right, but in this case i tried ha-card first and it seems to give the same result. Background, color and font-weight changes how it looks, but font-size seems to make no difference.
Try !important in such cases first. Did you do this? You can see this good in developer tools in Chrome, etc. as well. Just open it and see which styles are applied and which are crossed out, etc. If your set value is crossed out then another one overruling and you can avoid via !important.
And you can set any color you want, not only named.
Thanks. You seem to be right it is crossed out (see picture on the bottom), not sure why though, but what does it mean to try “!important”? Do I have to write !important font-size: 80px? And to set an RGB-color how do i do it? Rgb(x,x,x) instead of “red”?
Thanks, I’m sorry I am not that skilled with CSS, I tried googling, that is why i came up with the original solution. As with the testing, it just felt easier to ask about what the right syntax was instead of trying stuff that could just as well not work. Sorry for wasting your time.
Bit thanks a lot for the solution, it now works just like i wanted with the !important-tag and the rgb(x,x,x) syntax.
@ATWindsor let me explain you how it works.
To help you someone in most cases should:
take your code,
paste it into own dashboard,
add necessary sensors, replace your sensors in the code with the added sensors,
see if styles what you need are applied,
try to experiment with different CSS properties, adding “!important”, changing DOM navigation.
This is not “1-second-glance”. This all takes time.
And this may be done by YOU.
There are a lot of examples here.
Enough to use them by “copy/paste”, enough to adapt them to personal needs, enough to self-educate.
I understand it can take time to help, and i appreciate the help. I dont expect people to change out their whole config to help either (I don’t if I answer questions, i certainly understand why people won’t bother with that).
But while I agree I of course have the ability to educate myself to a high level in the subject if I put in the time, I don’t think it is that unreasonable to ask a question like this, I did go through the examples first, that is why i had the code i had, and tried exchanging ha-card with :host for instance, but In the examples i found no-one used an rgb-code, and the font size didn’t have important in front of it. I also tried things like em, percentage, “large” and so on with the font size. I don’t want to sound ungrateful, I am genuinely happy for the help, but I had a problem i wanted to solve, card-mod looked like the tool for the job, sometimes in can cost you quite a considerable amount of time trying to search for a problem that isn’t even necessarily solvable with the tool you chose. (I began with a different integration before but card-mod seems like a better solution).
Learning any new stuff like card-mod is not an easy task.
This all needs a “try / make an error / repeat” approach.
I myself have never dealt with any web-programming, a “CSS” word I came to know in this thread first.
One thing is here.
When I started learning card-mod, I decided to create test cards with examples to cover different cases. That was a good lesson, a good practice.
A bit later I decided to post these examples in this thread.
All my examples here available in the consolidation post (1st post → link at the bottom).
Examples for the “button” card are not there - probably because most people are using a more powerful “custom:button-card”.
I think I should prepare some examples with the “button” card too.
…and you should not use a code for a “xxx-card” to style a “yyy-card”.
These cards may have different structure, different CSS properties.
What you can do with some new card is - using Code Inspector, try to use methods which you learned with other cards.
I found a lot of good solutions here. I have a problem that I couldn’t figure out. I want to hide this entire column.
I can hide the cards separately by entity status, but I can’t hide the VERTICAL-STACK at the same time.