Skip to content
Snippets Groups Projects
Commit 89b9d832 authored by Kasper Seweryn's avatar Kasper Seweryn :pancakes:
Browse files

feat: add max modal height

Part-of: <!95>
parent 0dd3a038
Branches
Tags
1 merge request!95add max modal width and height
Pipeline #34020 passed
...@@ -7,12 +7,13 @@ const open = defineModel<boolean>({ required: true }) ...@@ -7,12 +7,13 @@ const open = defineModel<boolean>({ required: true })
<Teleport to="body"> <Teleport to="body">
<Transition mode="out-in"> <Transition mode="out-in">
<div v-if="open" @click.exact.stop="open = false" class="funkwhale overlay"> <div v-if="open" @click.exact.stop="open = false" class="funkwhale overlay">
<div @click.stop class="funkwhale modal"> <div @click.stop class="funkwhale modal" :class="$slots.alert && 'has-alert'" >
<h2> <h2>
{{ title }} {{ title }}
<FwButton icon="bi-x-lg" color="secondary" variant="ghost" @click="open = false" /> <FwButton icon="bi-x-lg" color="secondary" variant="ghost" @click="open = false" />
</h2> </h2>
<div class="modal-content">
<Transition> <Transition>
<div v-if="$slots.alert" class="alert-container"> <div v-if="$slots.alert" class="alert-container">
<div> <div>
...@@ -21,7 +22,6 @@ const open = defineModel<boolean>({ required: true }) ...@@ -21,7 +22,6 @@ const open = defineModel<boolean>({ required: true })
</div> </div>
</Transition> </Transition>
<div class="modal-content">
<slot /> <slot />
</div> </div>
<div v-if="$slots.actions" class="modal-actions"> <div v-if="$slots.actions" class="modal-actions">
......
...@@ -6,24 +6,9 @@ ...@@ -6,24 +6,9 @@
max-width: min(90vw, 40rem); max-width: min(90vw, 40rem);
width: 100%; width: 100%;
> .alert-container {
display: grid; display: grid;
grid-template-rows: 1fr; max-height: 90vh;
grid-template-rows: auto 1fr auto;
&.v-enter-active,
&.v-leave-active {
transition: grid-template-rows 0.2s ease;
}
&.v-enter-from,
&.v-leave-to {
grid-template-rows: 0fr;
}
> div {
overflow: hidden;
}
}
> h2 { > h2 {
font-size: 1.25em; font-size: 1.25em;
...@@ -42,7 +27,32 @@ ...@@ -42,7 +27,32 @@
} }
.modal-content { .modal-content {
padding: 1rem 2rem 1rem; padding: 1rem 2rem;
overflow: auto;
position: relative;
> .alert-container {
position: sticky;
top: -1rem;
margin: -1rem -2rem 1rem;
display: grid;
grid-template-rows: 1fr;
&.v-enter-active,
&.v-leave-active {
transition: grid-template-rows 0.2s ease;
}
&.v-enter-from,
&.v-leave-to {
grid-template-rows: 0fr;
}
> div {
overflow: hidden;
}
}
} }
.modal-actions { .modal-actions {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment