Hello community,
I’m modifying this room card, but when it comes to including styles in mushroom it doesn’t apply
Code:
type: custom:button-card
name: null
icon: mdi:sofa
icon_color: "#4d4d4d"
custom_fields:
temp: >
[[[ return states['sensor.aemet_daily_forecast_temperature'].state + '°C'
]]]
hum: |
[[[ return states['sensor.aemet_daily_forecast_temperature'].state + '%' ]]]
btn1:
card:
type: custom:mushroom-light-card
entity: light.ventilador_despacho
primary_info: none
secondary_info: none
tap_action:
action: toggle
icon: mdi:floor-lamp
use_light_color: false
card_mod:
style: |
ha-card {
background-color:
[[[
if (states['light.ventilador_despacho'].state === 'off') return '#F8E1B7'; # Fondo cuando está apagado
return '#754E1A'; # Fondo cuando está encendido
]]];
border-radius: 20px;
}
ha-state-icon {
color: orange;
}
btn2:
card:
type: custom:mushroom-light-card
entity: light.interruptor_despacho_luz_de_fondo
primary_info: none
secondary_info: none
tap_action:
action: toggle
icon: mdi:television-ambient-light
card_mod:
style: |
ha-card {
background-color: "#333333"; # Cambiar el color de fondo de btn2
border-radius: 0px; # Eliminar el borde redondeado de btn2
}
icon:
- color: "#ffffff"
- border-radius: 0px
btn3:
card:
type: custom:mushroom-light-card
entity: light.interruptor_despacho_luz_de_fondo
primary_info: none
secondary_info: none
tap_action:
action: toggle
icon: mdi:television-ambient-light
btn4:
card:
type: custom:mushroom-light-card
entity: light.interruptor_despacho_luz_de_fondo
primary_info: none
secondary_info: none
tap_action:
action: toggle
icon: mdi:television-ambient-light
styles:
grid:
- grid-template-areas: "\"n n n\" \"temp temp temp\" \"hum hum hum\" \". btn1 btn2 \" \". btn3 btn4\""
- grid-template-columns: 1fr min-content min-content
- grid-template-rows: repeat(3, min-content) repeat(2, min-content)
card:
- padding: 22px 8px 8px 22px
- height: 200px
custom_fields:
temp:
- justify-self: start
- font-size: 14px
- opacity: "0.7"
- padding-top: 10px
hum:
- justify-self: start
- font-size: 14px
- opacity: "0.7"
btn1:
- grid-area: btn1
- justify-content: center
- align-self: start
- padding-top: 0px
btn2:
- grid-area: btn2
- justify-content: center
- align-self: start
btn3:
- grid-area: btn3
- justify-content: center
- align-self: start
btn4:
- grid-area: btn4
- justify-content: center
- align-self: start
name:
- justify-self: start
- font-size: 18px
- font-weight: 500
- color: white
img_cell:
- justify-content: start
- position: absolute
- width: 100px
- height: 100px
- left: 0
- bottom: 0
- margin: 0 0 -20px -20px
- background: "#b5b5b5"
- border-radius: 500px
icon:
- position: relative
- width: 40px
- color: black
- opacity: "0.8"
- border-radius: 0px