Would someone be able to help me achieve a blinking entity image based on the entity state please? Iāve looked through this thread searaching for entity card examples, but canāt find one that is state based. I have gone a bit card-mod blind after scanning through the thread so may have missed what Iām looking for!
I have a basic entities card with the following config:
If I want this entity state picture to ONLY blink when the entity card is displaying the picture for the ERROR or WARNING states, how do I configure the card with card-mod?
I believe I need to include some card-mod style such as
animation: blink 2s ease infinite
if
is_state('sensor.oil_status', 'WARNING' or 'ERROR')
but Iām stuck on the syntax so it only applies to this one entity within the entity card, and still shows the static pictures for this entity when itās not in either of these 2 states.
Could somebody help a bloody Beginner to alter an Element inside a Shadow Root?
I managed to find and alter ānormalā Elements, but just donāt get it with the Shadow-Root Thing
I want to remove both Value and Title Elements from a Gauge Card. In Inspector setting Text Size to 0px works quite well.
How can i adress the "svg class="text" or "text class="value-text" ?
Iām at the very limits of my CSS knowledge here, and donāt actually use the Gauge card myself, but in theory this is how you would access these elements, combined with elements before the shadow-root level (here the font-size of the entity name):
However, it depends what aspect of these elements you want to modify. Itās complicated by the fact that these elements are contained within a flexible viewbox, which means that changing things like font-size directly on these elements probably wonāt work, as they just get scaled up again by the viewbox properties.
Instead, you would have to change the dimensions of the viewbox itself. Hereās code that works (Firefox browser on Windows desktop) to change both size and color of the gauge value for example, but I have no idea if this would work desirably and consistently across different views, browsers and devices:
Whoooa amazing!!! You are a true Hero! It works perfectly
Now, as i want to learn it, im gonna go through all Lines and check all of them for their functionā¦ Thank you so much again, highly appreciate your help!
I donāt fancy the date and time picker changes from a few releases ago: Theyāre too high for my taste, so Iām trying to change it. I donāt know if there are theme variables for this (I failed to find any), so Iāve been experimenting with card mod.
I canāt figure out the CSS selector chain to achieve this. I even forced some changes by using the * selector for all elements and setting some property values with !important just to get some kind of effect for testing purposes. I went through the CSS selector docs and combinator docs to see if thereās anything I could use.
I donāt think what I want to do is possible, but perhaps someone here knows (could find anything on the large card mod threads either) how to achieve this.
Here is a screenshot with the styles applied manually. The hour and minute elements must be styled separately from the AM/PM picker: I couldnāt get a parent element styled to do both in one go.
Card mod should be added at <div class=āflex justify-between h-44 p-3 area-buttonā ā¦ >
An this is the yaml code which is added right now. ha-card should be changed to .area-button.
But just this isnāt doing it. I think I am missing something. maybe a class before the area button.
Iām pretty sure this isnāt correct for starters, or at least it doesnāt look like anything Iāve done with card-mod. But I donāt use Dwainās Dashboard, so I might be completely off the mark here. Or maybe you are using a very old version of the card?
Check the card-mod documentation, but I would expect it to start like this:
card_mod:
style: |
...<etc>
EDIT: on second thoughts, you might be trying to follow the guidance on styling cards without an <ha-card> element. But even that would look something like this (shamelessly copied from the documentation):
type: custom:mod-card
card:
type: vertical-stack # for example
...
card_mod:
style: |
...<etc>
Do not think itās required.
The OP should find out how to style these Area cards first, then he could add the code into themeās file - if he really needs it.
When I try to add the same code on .area-button in developer tools it works. But I donāt get it to work when I change the theme yaml file. Thatswhy I posted here.
I need assistance with putting this code into the theme file.
to chrome dev tools the cards have a different look. But when I add this code into my theme file nothing happens. I tried different syntax to show anything from card mod theme but nothing worked for me so Iām here for help.
I want the code above to be in "<card-mod slot=ānoneā but for now there is no card mod slot on these area cards. So how Im gonna add this card mod slot?
@Bourner Imho this is rather rare case, I would suggest to ask this question in a thread dedicated to that auto-generated dashboard.
This case I cannot simulate; adding the Area card manually does not seem to help, I cannot see the āarea-buttonā selector you mentioned.
Hence, do not think that moving the question to card-mod-theme thread may help.
Its not the default HA card for areas. its something from dwains dashboard.
I already asked the developer but didnāt get an answer so I thought this is the correct place.
So in general how would you style a div that has no ha-card element with card-mod themes?
In case of using cards w/o ha-card in a normal dashboard - place the card into mod-card (as it was already advised to you).
But since you have no control on your cards - cannot advise anything thenā¦
Imho this auto-generated solutions may cause more problems than solutions where you have a full control.