insomnia/packages/insomnia-app/app/ui/css/components/modal.less
2020-04-26 13:33:39 -07:00

167 lines
3.3 KiB
Plaintext

.modal {
// Hidden state
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
padding: var(--padding-lg);
&:focus {
outline: 0;
}
.modal__backdrop {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: -1;
}
.modal__content__wrapper {
width: var(--modal-width);
height: 100%;
max-width: 100%;
max-height: 100%;
margin: auto;
// We want pointer events to pass through to the backdrop so we can close it
pointer-events: none;
}
&.modal--fixed-height .modal__content {
height: 100%;
}
&.modal--wide .modal__content__wrapper {
width: var(--modal-width)-wide;
}
&.modal--skinny .modal__content__wrapper {
width: var(--modal-width-skinny);
}
.modal__content {
display: grid;
grid-template-columns: 100%;
grid-template-rows: auto minmax(0, 1fr) auto;
border-radius: var(--radius-md);
overflow: visible;
box-sizing: border-box;
box-shadow: 0 0 2rem 0 rgba(0, 0, 0, 0.2);
max-width: 100%;
max-height: 100%;
width: 100%;
background-color: var(--color-bg);
color: var(--color-font);
border: 1px solid var(--hl-sm);
// Since we disable pointer-events on the parent, re-enable them here
pointer-events: auto;
}
.modal__header {
overflow: hidden;
border-bottom: 1px solid var(--hl-md);
height: var(--line-height-md);
font-size: var(--font-size-lg);
line-height: var(--line-height-md);
background-color: var(--color-bg);
color: var(--color-font);
display: flex;
flex-direction: row;
.modal__header__children {
padding-left: var(--padding-md);
width: 100%;
& > * {
display: inline-block;
line-height: normal;
}
}
.modal__close-btn {
height: 100%;
}
}
&.modal--noescape .modal__close-btn {
display: none;
}
.modal__body {
overflow: auto;
min-height: 2rem;
box-sizing: border-box;
max-width: 100%;
background-color: var(--color-bg);
color: var(--color-font);
&.modal__body--no-scroll {
overflow: visible;
height: 100%;
}
}
.modal__footer {
border-top: 1px solid var(--hl-sm);
background-color: var(--color-bg);
color: var(--color-font);
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: 1px;
button {
padding: 0 var(--padding-md);
&.studio-action-btn {
color: #0084d5;
float: left;
.with-icon {
display: flex;
align-items: center;
svg,
div {
float: left;
}
}
}
}
}
.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;
}
.modal__content > *:last-child {
border-bottom-left-radius: var(--radius-md);
border-bottom-right-radius: var(--radius-md);
}
.modal__content > *:first-child {
border-top-left-radius: var(--radius-md);
border-top-right-radius: var(--radius-md);
}
.status-loading {
width: 30px;
height: 30px;
display: inline-block;
path {
fill: #004ec1;
}
}
}
.modals {
width: 0;
height: 0;
}