Skip to content

Commit ea3ee6d

Browse files
committed
Add safe areas to ha-hanel-custom
1 parent aa3384b commit ea3ee6d

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/panels/custom/ha-panel-custom.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,19 @@ export class HaPanelCustom extends ReactiveElement {
147147
<style>
148148
iframe {
149149
border: 0;
150-
width: 100%;
151-
height: 100%;
150+
width: calc(100% - var(--safe-area-inset-right, 0px));
151+
height: calc(100% - var(--safe-area-inset-top, 0px) - var(--safe-area-inset-bottom, 0px));
152152
display: block;
153153
background-color: var(--primary-background-color);
154+
margin-top: var(--safe-area-inset-top);
155+
margin-bottom: var(--safe-area-inset-bottom);
156+
margin-right: var(--safe-area-inset-right);
157+
}
158+
@media (max-width: 870px) {
159+
iframe {
160+
width: calc(100% - var(--safe-area-inset-left, 0px) - var(--safe-area-inset-right, 0px));
161+
margin-left: var(--safe-area-inset-left);
162+
}
154163
}
155164
</style>
156165
<iframe ${titleAttr}></iframe>`.trim();

0 commit comments

Comments
 (0)