Skip to content

Commit

Permalink
Fix mobile dialog styling (excalidraw#1363)
Browse files Browse the repository at this point in the history
  • Loading branch information
j-f1 authored Apr 10, 2020
1 parent f134211 commit 16a3aa7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
6 changes: 5 additions & 1 deletion src/components/Modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,16 @@
position: relative;
z-index: 2;
width: 100%;
max-width: 100%;
max-width: var(--max-width);

opacity: 0;
transform: translateY(10px);
animation: Modal__content_fade-in 0.1s ease-out 0.05s forwards;
position: relative;

@media #{$media-query} {
max-width: 100%;
}
}

@keyframes Modal__content_fade-in {
Expand Down
12 changes: 7 additions & 5 deletions src/components/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ export function Modal(props: {
<div className="Modal__background" onClick={props.onCloseRequest}></div>
<div
className="Modal__content"
style={{
maxWidth: props.maxWidth,
maxHeight: "100%",
overflowY: "scroll",
}}
style={
{
"--max-width": `${props.maxWidth}px`,
maxHeight: "100%",
overflowY: "scroll",
} as any
}
>
{props.children}
</div>
Expand Down

0 comments on commit 16a3aa7

Please sign in to comment.