zavjah
(zavjah)
August 6, 2023, 7:22pm
4982
Hi there,
Iām having this card with conditional switches in it and I just cannot get the icons colored:
type: entities
title: Schlafzimmer
entities:
- type: conditional
conditions:
- entity: switch.drucker
state: 'off'
row:
entity: switch.drucker
type: button
icon: mdi:printer-off
name: Drucker aus
action_name: Einschalten
card_mod:
style: |
:host {
--paper-item-icon-color: red;
}
- type: conditional
conditions:
- entity: switch.drucker
state: 'on'
row:
entity: switch.drucker
type: button
icon: mdi:printer
name: Drucker an
action_name: Ausschalten
style:
hui-simple-entity-row$: |
hui-generic-entity-row {
--paper-item-icon-color: orange;
}
- type: conditional
conditions:
- entity: input_boolean.fernsehereg
state: 'off'
row:
entity: sun.sun
icon: mdi:desk-lamp
name: Test entity
style:
hui-simple-entity-row$: |
hui-generic-entity-row {
--paper-item-icon-color: red;
}
The icon in the last entry, conditional too, is colored red, just as wanted, but none of the above two work! Is it because they are switches?
Please help,
zavjah
No idea, getting some weird resultsā¦
mkanet
(MKANET)
August 6, 2023, 9:59pm
4984
I am trying to change stack-in-card ās header āpadding-bottom ā to 0px globally to all my stack-in-cardās via my theme.yaml .
The only way I can change the CSS style is via a single stack-in-card via Developer Tools (in the screenshot example below). Iāve already spent hours on this trying to figure this out on my own without any luck. I am hoping someone will be able to help; as Iāve tried everything I possibly could.
I tried applying card-mod custom CSS via stack-in-card code below without any luck.
Things Iāve triedā¦
cards:
- entities:
- entity: sensor.titan_download_speed
icon: mdi:speedometer
name: Download Speed
- entity: sensor.titan_upload_speed
icon: mdi:speedometer
name: Upload Speed
type: entities
- aspect_ratio: 56%
camera_view: live
entity: camera.desktop
show_state: false
type: picture-entity
title: Server
type: custom:stack-in-card
card_mod:
style: |
.card-header, :host ::slotted(.card-header) {
padding-bottom: 0px !important;
}
I also tried:
card_mod:
style: |
ha-card.card-header, h1.card-header {
padding-bottom: 0 !important;
}
andā¦
card_mod: |
style: |
ha-card.type-custom-stack-in-card, h1.card-header {
padding-bottom: 0px !important;
}
Not a single thing I tried works, unfortunately.
Donāt you see that the ācard-headerā is inside shadowRoot?
code
type: custom:stack-in-card
title: xxxxxxxxxxxxxxxxxxx
cards:
- type: entities
entities:
- entity: sun.sun
- show_state: false
show_name: true
type: picture-entity
entity: sun.sun
image: /local/images/test/ishimura.png
card_mod:
style:
$: |
.card-header {
background: cyan;
}
mkanet
(MKANET)
August 6, 2023, 10:31pm
4986
@Ildar_Gabdullin thank you so much. This is my first experience with shadowRoot. The code works within that specific card.
I tried to globally make this change in my theme.yaml (see code below); however, it doesnāt seem to affect any of my similar stack-in-cards. I completely deleted the web browser cache and reloaded the webpage without any luck.
I just appended the card-mod code you gave me to the bottom of my theme.yaml file (code below)ā¦ however, it didnāt make any difference:
card-mod-theme: techleech
header-height: 56px
card-mod-root: |
.edit-mode, app-header, app-toolbar {
background: var(--app-header-background-color) !important;
color: var(--primary-text-color) !important;
}
ha-tabs {
--paper-tabs-selection-bar-color: var(--primary-color) !important;
}
paper-tab[aria-selected=true] {
color: var(--primary-color) !important;
}
card-mod-row-yaml: |
.: |
hui-generic-entity-row {
height: 38px;
}
card_mod:
$: |
.card-header {
padding-bottom: 0 !important;
}
mkanet
(MKANET)
August 7, 2023, 1:33am
4988
Thank you. This worked:
card-mod-card-yaml: |
$: |
.card-header {
padding-bottom: 0 !important;
}
This style is applied to all cards with ā.card-headerā inside shadowRoot, not to āstack-in-cardā only.
mkanet
(MKANET)
August 7, 2023, 4:10am
4991
I tried my best. Iām not sure how to specify only stack-in-card.
FGOD1983
(Willem)
August 7, 2023, 9:43am
4992
I gave you a link how to style classes.
Statistics graph: replacing a label
Consider a Statistics graph with ONE selected line (let it be MAX):
If you do not like this āmaxā word - the label can be w/o it, any text may be specified here:
code
type: statistics-graph
entities:
- sensor.xiaomi_cg_1_temperature
stat_types:
- max
card_mod:
style:
.content statistics-chart $ ha-chart-base $: |
.chartLegend li .label {
font-size: 0px;
display: flex;
}
.chartLegend li .label:before {
color: var(--secondary-text-color);
content: "any text";
font-size: var(--mdc-typography-body1-font-size,1rem);
}
2 Likes
ipod86
August 7, 2023, 12:13pm
4995
Hello,
I have the following āpicture entityā:
type: picture-elements
elements:
- type: custom:hui-element
card_type: entities
entities:
- entity: input_select.aber
style:
top: 80%
left: 50%
width: 200px
image: /cards/roborock.png
Now I would like to remove everything and just keep the text from the dropdown and the arrow.
It should only look like text that you can fold out.
Unfortunately, Iām completely at the end of my rope.
Already told you where to start: 1st post ā link at the bottom ā styles for input-select (how to style the row).
Suggest you to start testing with a simple input_select inside Entities card, not for complex cases like āinput-select inside hui-element inside Picture elementsā.
ipod86
August 7, 2023, 12:23pm
4997
I read through the things. however, I have absolutely no knowledge of css. That then in connection with the google translator makes it very difficult for me (my English from school is very dusty).
Iāll keep testing.
ipod86
August 7, 2023, 12:58pm
4998
Made it this far now. A colleague helped me.
Now we only fail because of the shadow.
We actually thought we would have removed that too.
- type: custom:hui-element
card_type: entities
entities:
- entity: input_select.aber
card_mod:
style:
hui-generic-entity-row $: |
state-badge {
display: none;
}
ha-select $: |
.mdc-select__anchor {
height: 40px !important;
}
.mdc-select__selected-text-container {
align-self: center;
}
span#label {
display: none;
}
ha-card {
border: 0px;
background: none;
box-shadow: none;
}
.card-header {
background-color: var(--primary-background-color);
}
.: |
ha-select {
height: 40px;
width: 120px;
}
style:
top: 80%
left: 50%
width: 200px
ipod86:
border: 0px;
Try āborder: noneā (have not check other things)
ipod86
August 7, 2023, 1:22pm
5000
ipod86:
border: 0px;
Unfortunately, that makes no difference.
You have to use Code Inspector & learn CSS a little - using card-mod is not just ācopy / pasteā things ((((((
step by stepā¦
ipod86
August 7, 2023, 1:57pm
5002
Iāll try it. If I donāt find out, Iāll get back to you later (at some point).