Skip to content

Commit

Permalink
fix: Actions in overlays on mobile hard to press (#759)
Browse files Browse the repository at this point in the history
* fix: Actions in overlays on mobile hard to press

Buttons on mobile devices could've been cut off, depending on the browsers
chrome size which rendered them either completely off-screen or at least hard
to reach. Using `dvh` (dynamic viewport height) should fix this issue for
most newer browsers.

* fix: provide fallback values for newer dynamic viewport units

Since `dvh` and `dvw` are rather new and required an up-to-date browser
providing percentage values is a bit safer

---------

Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com>
  • Loading branch information
cbe and fmartingr committed Oct 22, 2023
1 parent f82b97d commit 1ae82f4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion internal/view/assets/css/style.css

Large diffs are not rendered by default.

20 changes: 13 additions & 7 deletions internal/view/assets/less/common.less
Expand Up @@ -55,7 +55,8 @@ a {
}

#login-scene {
height : 100vh;
height : 100%;
height : 100dvh;
padding : 16px;
overflow : auto;
display : flex;
Expand Down Expand Up @@ -186,7 +187,8 @@ a {
}

#main-scene {
min-height : 100vh;
min-height : 100%;
min-height : 100dvh;
padding-top : 60px;
padding-left : 60px;
background-color: var(--bg);
Expand All @@ -195,7 +197,8 @@ a {
top : 0;
left : 0;
width : 60px;
height : 100vh;
height : 100%;
height : 100dvh;
position : fixed;
display : flex;
flex-flow : column nowrap;
Expand Down Expand Up @@ -298,8 +301,10 @@ a {
position : fixed;
top : 0;
left : 0;
width : 100vw;
height : 100vh;
width : 100%;
width : 100dvw;
height : 100%;
height : 100dvh;
z-index : 10001;
background-color: rgba(0, 0, 0, 0.6);

Expand All @@ -322,7 +327,8 @@ a {
top : auto;
right : 0;
bottom : 0;
width : 100vw;
width : 100%;
width : 100dvw;
height : 50px;
flex-flow : row nowrap;
border-top: 1px solid var(--border);
Expand Down Expand Up @@ -801,4 +807,4 @@ a {
}
}
}
}
}
6 changes: 4 additions & 2 deletions internal/view/assets/less/custom-dialog.less
Expand Up @@ -14,8 +14,10 @@
position : fixed;
top : 0;
left : 0;
width : 100vw;
height : 100vh;
width : 100%;
width : 100dvw;
height : 100%;
height : 100dvh;
z-index : 10001;
background-color: rgba(0, 0, 0, 0.6);
padding : 32px;
Expand Down

0 comments on commit 1ae82f4

Please sign in to comment.