Use hack to use fixed image as background in safari

This commit is contained in:
Paul Bottein 2024-04-30 20:52:29 +02:00
parent 42b5fa696a
commit 925e0230b1
No known key found for this signature in database
2 changed files with 24 additions and 0 deletions

View File

@ -401,10 +401,22 @@ class PanelEnergy extends LitElement {
padding-inline-start: env(safe-area-inset-left);
padding-inline-end: env(safe-area-inset-right);
padding-bottom: env(safe-area-inset-bottom);
}
/* Hack to support fixed background image on iOS */
#view:after {
display: block;
content: "";
top: 0;
left: 0;
width: 100%;
height: 100%;
position: fixed;
background: var(
--lovelace-background,
var(--primary-background-color)
);
background-attachment: local;
z-index: -1;
}
#view > * {
flex: 1 1 100%;

View File

@ -1074,10 +1074,22 @@ class HUIRoot extends LitElement {
padding-inline-start: env(safe-area-inset-left);
padding-inline-end: env(safe-area-inset-right);
padding-bottom: env(safe-area-inset-bottom);
}
/* Hack to support fixed background image on iOS */
#view:after {
display: block;
content: "";
top: 0;
left: 0;
width: 100%;
height: 100%;
position: fixed;
background: var(
--lovelace-background,
var(--primary-background-color)
);
background-attachment: local;
z-index: -1;
}
#view > * {
flex: 1 1 100%;