Skip to content

Commit 98e9baf

Browse files
committed
fix: tweak header and drawer padding when viewing on a device with curved edges
1 parent 347e2fe commit 98e9baf

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

packages/uikit-workshop/src/scripts/lit-components/pl-drawer/pl-drawer.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ pl-drawer {
3737
overflow: hidden;
3838
max-width: 100vw;
3939

40+
@supports(padding: max(0px)) {
41+
padding-left: calc(env(safe-area-inset-left) / 2);
42+
padding-right: calc(env(safe-area-inset-right) / 2);
43+
}
44+
4045
.pl-c-body--theme-sidebar & {
4146
@media all and (min-width: $pl-bp-med) {
4247
max-width: calc(100vw - #{$pl-sidebar-width});

packages/uikit-workshop/src/scripts/lit-components/pl-header/pl-header.scss

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,18 @@ pl-header {
2121
border-right: 1px solid;
2222
border-right-color: $pl-color-gray-20;
2323
border-right-color: var(--theme-border, $pl-color-gray-20);
24+
padding-left: calc(env(safe-area-inset-left) / 2);
25+
padding-right: calc(env(safe-area-inset-right) / 2);
2426

2527
.pl-c-body--theme-light & {
2628
color: $pl-color-black;
2729
background-color: $pl-color-white;
2830
}
2931

32+
.pl-c-body--theme-sidebar & {
33+
padding-right: 0;
34+
}
35+
3036
@media all and (min-width: $pl-bp-med) {
3137
.pl-c-body--theme-sidebar & {
3238
position: fixed;
@@ -61,10 +67,6 @@ pl-header {
6167
min-height: 30px; // magic number -- needed for initial skeleton screen styles used in the critical CSS
6268
background-color: inherit;
6369

64-
@supports(padding: max(0px)) {
65-
padding-left: env(safe-area-inset-left);
66-
padding-right: env(safe-area-inset-right);
67-
}
6870

6971
@media all and (min-width: $pl-bp-med) {
7072
.pl-c-body--theme-sidebar & {

0 commit comments

Comments
 (0)