Hi everyone, Iām coming to you with a question somehow I canāt figure out why this is happening. I use for custom popup card with browser mod integration and in it I modify styles for css using card-mod.
I have one main theme for the whole system, which contains only basic variables for HA and a small part for card-mod-more-info-yaml configuration, for the dashboard I have another theme separately, which contains its own variables and another card-mod-view-yaml for a specific dashboard view.
Moving on to the problem, lately Iāve been experiencing a little delayed response after opening a custom popup and css styles reload after with lag, depending on how much custom css is used in it. I donāt know if it happened before the card-mod update or after. To find out the cause of the problem in the dev tools where the error is, the cause of the delay is in the use of the card-mod module to modify the css popup content elements.
So I want to ask more experienced people if anyone has encountered and solved a similar problem, or advised how to properly use the css for the popup content with the browser mod without getting an error. Thank you in advance for your answersā¦
Main theme
Main Theme
card-mod-theme: Main Theme
card-mod-more-info-yaml: |
.: |
ha-dialog {
--vertical-align-dialog: var(--tablet-popup-align-dialog) !important;
--dialog-surface-margin-top: var(--tablet-popup-margin-top) !important;
--dialog-box-shadow: 0 0px 16px 4px rgba(101,115,134, .15), 0 16px 64px 32px rgba(101,115,134, .5) !important;
--mdc-theme-surface: rgba(34,38,39,1) !important;
}
ha-dialog > div.content > div.container {
padding: 0 !important;
}
@media (max-width: 800px), (max-height: 500px) {
ha-dialog {
--mdc-dialog-min-width: 100vw !important;
--mdc-dialog-min-height: 100vh !important;
--popup-border-radius: 0 !important;
}
}
ha-dialog > div:focus {
outline: none;
}
$: |
.mdc-dialog__surface {
background-color: var(--popup-background-color) !important;
box-shadow: var(--dialog-box-shadow) !important;
}
Popup dialog
action: fire-dom-event
browser_mod:
service: browser_mod.popup
data:
title: MBPro Server
card_mod:
style:
ha-dialog$: |
:host {
--ha-card-border-width: 0 !important;
--ha-card-border-radius: 0px !important;
--ha-card-border-color: none !important;
--bar-card-border-radius: 12px !important;
--ha-card-box-shadow: none !important;
--ha-card-background: none !important;
--mdc-theme-surface: rgba(34,38,39,1) !important;
}
.mdc-dialog__surface {
background-color: var(--popup-background-color) !important;
}
layout-card:
$grid-layout$:
# card divider border
.: |
#root > * {
margin: 0px !important;
}
@media (max-width: 450px), (max-height: 500px) {
#root {
display: block !important;
}
}
hui-entities-card:
$: |
ha-card {
border-right: 0.1vw solid rgba(58, 69, 73, 0.2);
border-radius: 0;
transition: none;
}
/* portrait */
@media screen and (max-width: 800px) {
ha-card {
border-right: none;
border-bottom: 0.1vw solid rgba(58, 69, 73, 0.2);
}
}
$hui-horizontal-stack-card:
$: |
#root {
justify-content: space-evenly;
margin-top: 1.7em;
}
hui-entities-card:last-child:
$: |
ha-card {
border: none;
}
content:
type: custom:layout-card
layout_type: custom:grid-layout
layout: !include ../../snippets/popup_footer_layout.yaml
cards:
whole popop yaml codes
action: fire-dom-event
browser_mod:
service: browser_mod.popup
data:
title: MBPro Server
card_mod:
style:
ha-dialog$: |
:host {
--ha-card-border-width: 0 !important;
--ha-card-border-radius: 0px !important;
--ha-card-border-color: none !important;
--bar-card-border-radius: 12px !important;
--ha-card-box-shadow: none !important;
--ha-card-background: none !important;
--mdc-theme-surface: rgba(34,38,39,1) !important;
}
.mdc-dialog__surface {
background-color: var(--popup-background-color) !important;
}
layout-card:
$grid-layout$:
# card divider border
.: |
#root > * {
margin: 0px !important;
}
@media (max-width: 450px), (max-height: 500px) {
#root {
display: block !important;
}
}
hui-entities-card:
$: |
ha-card {
border-right: 0.1vw solid rgba(58, 69, 73, 0.2);
border-radius: 0;
transition: none;
}
/* portrait */
@media screen and (max-width: 800px) {
ha-card {
border-right: none;
border-bottom: 0.1vw solid rgba(58, 69, 73, 0.2);
}
}
$hui-horizontal-stack-card:
$: |
#root {
justify-content: space-evenly;
margin-top: 1.7em;
}
hui-entities-card:last-child:
$: |
ha-card {
border: none;
}
content:
type: custom:layout-card
layout_type: custom:grid-layout
layout: !include ../../snippets/popup_footer_layout.yaml
cards:
#################################################
# #
# HOME ASSISTANT #
# #
#################################################
- type: entities
title: ' '
show_header_toggle: false
card_mod:
class: header
entities:
- entity: binary_sensor.macbookpro
name: Active
state_color: true
- entity: sensor.mbproserver_connection_type
name: Connection
- entity: sensor.mbpro_uptime_usage
name: Uptime
- type: custom:bar-card
width: 55%
height: 2em
decimal: 0
unit_of_measurement: '%'
positions: &bar_card_positions
icon: outside
indicator: 'off'
name: outside
severity: &bar_card_severity
- color: '#9da0a2'
from: 0
to: 59
- color: '#9da0a2'
from: 60
to: 100
entity_row: true
entities:
- entity: sensor.mbpro_cpu_usage
name: Processor
- entity: sensor.mbpro_memory_usage
name: Memory
- type: custom:hui-horizontal-stack-card
cards:
- type: custom:button-card
name: Lock
icon: mdi:lock
tap_action:
action: call-service
service: shell_command.lock_mbpro
template: icon_name
- type: custom:button-card
name: Sleep
icon: mdi:power-sleep
tap_action:
action: call-service
service: shell_command.sleep_mbpro
template: icon_name
footer:
type: custom:mini-graph-card
# name: Speedtest
tap_action:
action: call-service
service: homeassistant.update_entity
service_data:
entity_id: sensor.mbpro_cpu_usage
entities:
- entity: sensor.mbpro_cpu_usage
name: Processor
color: '#00bb33'
- entity: sensor.mbpro_memory_usage
name: Memory
show_state: false
color: '#2196f3'
y_axis: secondary
hours_to_show: 48
hour24: true
line_width: 3
animate: true
# upper_bound_secondary: 100
show:
name: false
icon: false
state: false
legend: false
fill: fade
labels: true
labels_secondary: false
average: false
extrema: false
points: hover