2016-04-07 03:09:14 +00:00
|
|
|
@import '../constants/dimensions';
|
|
|
|
@import '../constants/colors';
|
|
|
|
|
|
|
|
.modal {
|
2017-03-08 05:52:17 +00:00
|
|
|
// Hidden state
|
|
|
|
opacity: 0;
|
|
|
|
z-index: -999999; // Component updates this manually
|
|
|
|
|
2017-03-09 06:23:23 +00:00
|
|
|
transition: opacity 250ms;
|
2016-04-07 03:09:14 +00:00
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
right: 0;
|
|
|
|
bottom: 0;
|
2016-08-29 17:58:59 +00:00
|
|
|
padding: @padding-lg;
|
2016-08-15 17:04:36 +00:00
|
|
|
|
2017-03-08 05:52:17 +00:00
|
|
|
&.modal--open {
|
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
|
2016-08-15 17:04:36 +00:00
|
|
|
&:focus {
|
|
|
|
outline: 0;
|
|
|
|
}
|
2016-06-20 06:05:40 +00:00
|
|
|
|
|
|
|
.modal__backdrop {
|
|
|
|
position: fixed;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
right: 0;
|
|
|
|
bottom: 0;
|
|
|
|
z-index: -1;
|
|
|
|
}
|
|
|
|
|
2017-03-16 17:51:56 +00:00
|
|
|
.modal__content__wrapper {
|
2017-03-09 06:23:23 +00:00
|
|
|
top: 1rem;
|
2017-03-16 17:51:56 +00:00
|
|
|
width: @modal-width;
|
2017-05-23 22:05:31 +00:00
|
|
|
height: 100%;
|
2017-03-16 17:51:56 +00:00
|
|
|
max-width: 100%;
|
|
|
|
max-height: 100%;
|
|
|
|
margin: auto;
|
|
|
|
position: relative;
|
2017-03-09 06:23:23 +00:00
|
|
|
transform: scale(0.95);
|
|
|
|
transition: transform 150ms ease-out, top 200ms ease-out;
|
2017-05-23 22:05:31 +00:00
|
|
|
|
|
|
|
// We want pointer events to pass through to the backdrop so we can close it
|
|
|
|
pointer-events: none;
|
2017-03-16 17:51:56 +00:00
|
|
|
}
|
|
|
|
|
2017-05-23 22:05:31 +00:00
|
|
|
&.modal--fixed-height .modal__content {
|
2017-03-16 17:51:56 +00:00
|
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.modal--open .modal__content__wrapper {
|
2017-03-28 22:45:23 +00:00
|
|
|
transform: scale(1);
|
2017-03-16 17:51:56 +00:00
|
|
|
top: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.modal--wide .modal__content__wrapper {
|
|
|
|
width: @modal-width-wide;
|
|
|
|
}
|
|
|
|
|
|
|
|
.modal__content {
|
2016-06-20 06:05:40 +00:00
|
|
|
display: grid;
|
2016-09-15 22:45:08 +00:00
|
|
|
grid-template-columns: 100%;
|
2016-09-20 20:53:34 +00:00
|
|
|
grid-template-rows: auto minmax(0, 1fr) auto;
|
2016-08-29 17:58:59 +00:00
|
|
|
border-radius: @radius-md;
|
2016-11-27 21:42:38 +00:00
|
|
|
overflow: visible;
|
2016-06-20 06:05:40 +00:00
|
|
|
box-sizing: border-box;
|
2016-08-15 17:04:36 +00:00
|
|
|
box-shadow: 0 0 2rem 0 rgba(0, 0, 0, 0.2);
|
2016-06-20 06:05:40 +00:00
|
|
|
max-width: 100%;
|
|
|
|
max-height: 100%;
|
2017-03-16 17:51:56 +00:00
|
|
|
width: 100%;
|
2017-01-23 22:41:31 +00:00
|
|
|
background-color: var(--color-bg);
|
|
|
|
color: var(--color-font);
|
2017-01-20 21:54:03 +00:00
|
|
|
border: 1px solid @hl-sm;
|
2017-05-23 22:05:31 +00:00
|
|
|
|
|
|
|
// Since we disable pointer-events on the parent, re-enable them here
|
|
|
|
pointer-events: auto;
|
2016-08-15 17:04:36 +00:00
|
|
|
}
|
|
|
|
|
2016-04-07 03:09:14 +00:00
|
|
|
.modal__header {
|
2016-08-29 17:58:59 +00:00
|
|
|
border-bottom: 1px solid @hl-md;
|
|
|
|
height: @line-height-md;
|
|
|
|
font-size: @font-size-lg;
|
|
|
|
line-height: @line-height-md;
|
2017-01-23 22:41:31 +00:00
|
|
|
background-color: var(--color-bg);
|
|
|
|
color: var(--color-font);
|
2016-11-29 20:55:31 +00:00
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
|
|
|
|
.modal__header__children {
|
|
|
|
padding-left: @padding-md;
|
|
|
|
width: 100%;
|
2017-05-17 19:02:09 +00:00
|
|
|
|
|
|
|
& > * {
|
|
|
|
display: inline-block;
|
|
|
|
}
|
2016-11-29 20:55:31 +00:00
|
|
|
}
|
2016-05-01 19:56:30 +00:00
|
|
|
|
|
|
|
.modal__close-btn {
|
|
|
|
height: 100%;
|
|
|
|
}
|
2016-04-07 03:09:14 +00:00
|
|
|
}
|
|
|
|
|
2017-03-03 01:44:07 +00:00
|
|
|
&.modal--noescape .modal__close-btn {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
2016-05-01 19:56:30 +00:00
|
|
|
.modal__body {
|
|
|
|
overflow: auto;
|
2016-07-25 22:27:29 +00:00
|
|
|
min-height: 2rem;
|
2016-08-15 17:04:36 +00:00
|
|
|
box-sizing: border-box;
|
|
|
|
max-width: 100%;
|
2017-01-23 22:41:31 +00:00
|
|
|
background-color: var(--color-bg);
|
|
|
|
color: var(--color-font);
|
2016-08-15 17:04:36 +00:00
|
|
|
|
|
|
|
&.modal__body--no-scroll {
|
|
|
|
overflow: visible;
|
|
|
|
height: 100%;
|
|
|
|
}
|
2016-05-01 19:56:30 +00:00
|
|
|
}
|
|
|
|
|
2016-04-07 03:09:14 +00:00
|
|
|
.modal__footer {
|
2016-08-29 17:58:59 +00:00
|
|
|
border-top: 1px solid @hl-md;
|
2017-01-23 22:41:31 +00:00
|
|
|
background-color: var(--color-bg);
|
|
|
|
color: var(--color-font);
|
2016-10-21 17:20:36 +00:00
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-between;
|
2017-05-03 17:48:23 +00:00
|
|
|
padding: 1px;
|
2016-10-21 17:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.modal__footer > *:last-child {
|
|
|
|
// Push last item of footer to right. This is very important to pull right
|
|
|
|
// if there is only a single item in the footer.
|
|
|
|
margin-left: auto;
|
2016-04-07 03:09:14 +00:00
|
|
|
}
|
2016-07-07 20:10:55 +00:00
|
|
|
|
2017-03-09 06:23:23 +00:00
|
|
|
.modal__content > *:last-child {
|
2016-08-29 17:58:59 +00:00
|
|
|
border-bottom-left-radius: @radius-md;
|
|
|
|
border-bottom-right-radius: @radius-md;
|
2016-07-07 20:10:55 +00:00
|
|
|
}
|
|
|
|
|
2017-03-09 06:23:23 +00:00
|
|
|
.modal__content > *:first-child {
|
2016-08-29 17:58:59 +00:00
|
|
|
border-top-left-radius: @radius-md;
|
|
|
|
border-top-right-radius: @radius-md;
|
2016-07-07 20:10:55 +00:00
|
|
|
}
|
2016-04-07 03:09:14 +00:00
|
|
|
}
|
2017-03-08 05:52:17 +00:00
|
|
|
|
|
|
|
.modals {
|
|
|
|
width: 0;
|
|
|
|
height: 0;
|
|
|
|
}
|