Handle media > 2 taking a lot of vertical space

Also handle media > 4, which I think some instances probably allow
pull/20/head
Lim Chee Aun 2022-12-22 10:47:45 +08:00
rodzic ade3ebb5ae
commit 3c4c59106a
2 zmienionych plików z 15 dodań i 1 usunięć

Wyświetl plik

@ -277,6 +277,10 @@
gap: 2px;
flex-direction: row;
}
.status:not(.large) .media-container.media-gt4 {
flex-wrap: nowrap;
overflow: auto;
}
.status .media {
flex-grow: 1;
flex-basis: calc(50% - 8px);
@ -286,6 +290,12 @@
min-height: 80px;
border: 1px solid var(--outline-color);
}
.status .media-container.media-gt2 .media {
aspect-ratio: 1 / 1;
}
.status:not(.large) .media-container.media-gt4 .media {
min-width: 80px;
}
.status .media:hover {
border-color: var(--outline-hover-color);
}

Wyświetl plik

@ -406,7 +406,11 @@ function Status({
</button>
)}
{!!mediaAttachments.length && (
<div class="media-container">
<div
class={`media-container ${
mediaAttachments.length > 2 ? 'media-gt2' : ''
} ${mediaAttachments.length > 4 ? 'media-gt4' : ''}`}
>
{mediaAttachments.map((media, i) => (
<Media
media={media}