-
Notifications
You must be signed in to change notification settings - Fork 322
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Modal): wrap the overlay and modal inside a container, to allow …
…portaling with layer provider to the container (#2703)
- Loading branch information
1 parent
7c7608d
commit 6f4b9d5
Showing
2 changed files
with
60 additions
and
60 deletions.
There are no files selected for viewing
83 changes: 43 additions & 40 deletions
83
packages/core/src/components/Modal/Modal/Modal.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,50 @@ | ||
$modal-default-z-index: 10000; | ||
|
||
.overlay { | ||
.container { | ||
position: fixed; | ||
inset: 0; | ||
background-color: var(--color-surface); | ||
z-index: var(--monday-modal-z-index, $modal-default-z-index); | ||
} | ||
|
||
.modal { | ||
--top-actions-spacing: var(--spacing-large); | ||
--top-actions-width: var(--spacing-xl); | ||
--modal-inline-padding: var(--spacing-xl); | ||
|
||
position: fixed; | ||
top: 50%; | ||
left: 50%; | ||
z-index: var(--monday-modal-z-index, $modal-default-z-index); | ||
|
||
display: flex; | ||
flex-direction: column; | ||
width: var(--modal-width); | ||
max-height: var(--modal-max-height); | ||
background-color: var(--primary-background-color); | ||
overflow: hidden; | ||
border-radius: var(--border-radius-big); | ||
box-shadow: var(--box-shadow-large); | ||
|
||
&.withHeaderAction { | ||
--top-actions-width: calc(var(--spacing-xl) * 2); | ||
} | ||
|
||
&.sizeSmall { | ||
--modal-max-height: 50%; | ||
--modal-width: 480px; | ||
} | ||
z-index: var(--monday-modal-z-index, 10000); | ||
|
||
&.sizeMedium { | ||
--modal-max-height: 80%; | ||
--modal-width: 580px; | ||
.overlay { | ||
position: fixed; | ||
inset: 0; | ||
height: 100%; | ||
background-color: var(--color-surface); | ||
} | ||
|
||
&.sizeLarge { | ||
--modal-max-height: 80%; | ||
--modal-width: 840px; | ||
.modal { | ||
--top-actions-spacing: var(--spacing-large); | ||
--top-actions-width: var(--spacing-xl); | ||
--modal-inline-padding: var(--spacing-xl); | ||
|
||
position: relative; | ||
top: 50%; | ||
left: 50%; | ||
|
||
display: flex; | ||
flex-direction: column; | ||
width: var(--modal-width); | ||
max-height: var(--modal-max-height); | ||
background-color: var(--primary-background-color); | ||
overflow: hidden; | ||
border-radius: var(--border-radius-big); | ||
box-shadow: var(--box-shadow-large); | ||
|
||
&.withHeaderAction { | ||
--top-actions-width: calc(var(--spacing-xl) * 2); | ||
} | ||
|
||
&.sizeSmall { | ||
--modal-max-height: 50%; | ||
--modal-width: 480px; | ||
} | ||
|
||
&.sizeMedium { | ||
--modal-max-height: 80%; | ||
--modal-width: 580px; | ||
} | ||
|
||
&.sizeLarge { | ||
--modal-max-height: 80%; | ||
--modal-width: 840px; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters