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

fix: apply @mjourdan's suggestions

Part-of: <!93>
parent 368d1be9
No related branches found
No related tags found
1 merge request!93feat: add alert and modal components
Pipeline #33955 passed
...@@ -18,11 +18,10 @@ ...@@ -18,11 +18,10 @@
} }
@include dark-theme { @include dark-theme {
background-color: var(--fw-pastel-4, var(--fw-bg-color)); background-color: var(--fw-pastel-3, var(--fw-bg-color));
> .actions .funkwhale.button { > .actions .funkwhale.button {
--fw-bg-color: var(--fw-pastel-3); --fw-bg-color: var(--fw-pastel-4);
box-shadow: 0 2px 4px 2px rgba(#000, 0.1);
&:hover, &.is-hovered { &:hover, &.is-hovered {
--fw-bg-color: var(--fw-pastel-2); --fw-bg-color: var(--fw-pastel-2);
......
...@@ -8,7 +8,10 @@ const open = defineModel<boolean>({ required: true }) ...@@ -8,7 +8,10 @@ const open = defineModel<boolean>({ required: true })
<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">
<h2>{{ title }}</h2> <h2>
{{ title }}
<FwButton icon="bi-x-lg" color="secondary" variant="ghost" @click="open = false" />
</h2>
<Transition> <Transition>
<div v-if="$slots.alert" class="alert-container"> <div v-if="$slots.alert" class="alert-container">
...@@ -17,12 +20,10 @@ const open = defineModel<boolean>({ required: true }) ...@@ -17,12 +20,10 @@ const open = defineModel<boolean>({ required: true })
</div> </div>
</div> </div>
</Transition> </Transition>
<hr />
<div class="modal-content"> <div class="modal-content">
<slot /> <slot />
</div> </div>
<hr v-if="$slots.actions" />
<div v-if="$slots.actions" class="modal-actions"> <div v-if="$slots.actions" class="modal-actions">
<slot name="actions" /> <slot name="actions" />
</div> </div>
......
...@@ -6,15 +6,9 @@ ...@@ -6,15 +6,9 @@
min-width: 32rem; min-width: 32rem;
max-width: 90vw; max-width: 90vw;
> hr {
padding: 0;
margin: 0;
}
> .alert-container { > .alert-container {
display: grid; display: grid;
grid-template-rows: 1fr; grid-template-rows: 1fr;
margin-bottom: -1px;
&.v-enter-active, &.v-enter-active,
&.v-leave-active { &.v-leave-active {
...@@ -33,9 +27,18 @@ ...@@ -33,9 +27,18 @@
> h2 { > h2 {
font-size: 1.25em; font-size: 1.25em;
padding: 1.625rem 4.5rem 1rem; padding: 1.625rem 4.5rem;
line-height: 1.2; line-height: 1.2;
text-align: center; text-align: center;
position: relative;
> .funkwhale.button {
font-size: 1rem;
position: absolute;
right: 1rem;
top: 50%;
transform: translateY(-49%);
}
} }
.modal-content { .modal-content {
...@@ -44,6 +47,17 @@ ...@@ -44,6 +47,17 @@
.modal-actions { .modal-actions {
padding: 0.75rem 2rem 1rem; padding: 0.75rem 2rem 1rem;
display: flex;
justify-content: space-between;
align-items: flex-start;
> :first-child {
margin-left: 0px !important;
}
> :last-child {
margin-right: 0px !important;
}
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment