uploads: fix stretched images on Safari.
Fix images on the upload page appearing stretched (having the incorrect aspect ratio) when the image is enlarged on Safari. The fix is to set `aspect-ratio` and `height: intrinsic` to ensure the image is the right size. I have no idea how this works or why it's necessary on Safari. Fixes https://danbooru.donmai.us/forum_posts/227099.
This commit is contained in:
@@ -34,8 +34,22 @@
|
||||
}
|
||||
}
|
||||
|
||||
.media-asset-image {
|
||||
user-select: none;
|
||||
width: auto;
|
||||
height: auto;
|
||||
max-width: 100%;
|
||||
max-height: inherit;
|
||||
}
|
||||
|
||||
&.media-asset-container-fit-height {
|
||||
max-height: calc(100vh - var(--header-visible-height));
|
||||
justify-content: center;
|
||||
|
||||
.media-asset-component {
|
||||
aspect-ratio: var(--media-asset-width) / var(--media-asset-height);
|
||||
height: max-content;
|
||||
height: intrinsic; // XXX Safari-only hack to make images correct height on upload page. I have no idea how this works.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user