Skip to content

Commit 5082d67

Browse files
authored
Fix wide image overflowing from the thumbnail container (matrix-org#8663)
1 parent c1c3ed6 commit 5082d67

File tree

1 file changed

+23
-12
lines changed

1 file changed

+23
-12
lines changed

res/css/views/messages/_MImageBody.scss

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,29 @@ $timeline-image-border-radius: 8px;
5454
}
5555
}
5656

57-
.mx_MImageBody_thumbnail_container {
58-
border-radius: $timeline-image-border-radius;
59-
60-
// Necessary for the border radius to apply correctly to the placeholder
61-
overflow: hidden;
62-
contain: paint;
63-
64-
min-height: $font-44px;
65-
min-width: $font-44px;
66-
display: flex;
67-
justify-content: center;
68-
align-items: center;
57+
.mx_MImageBody {
58+
.mx_MImageBody_thumbnail_container {
59+
border-radius: $timeline-image-border-radius;
60+
61+
// Necessary for the border radius to apply correctly to the placeholder
62+
overflow: hidden;
63+
contain: paint;
64+
65+
min-height: $font-44px;
66+
min-width: $font-44px;
67+
display: flex;
68+
justify-content: center;
69+
align-items: center;
70+
71+
// Override inline max-width value to avoid overflow
72+
max-width: 100% !important;
73+
74+
.mx_MImageBody_thumbnail {
75+
// Apply the border radius to an image directly.
76+
// This is necessary for images smaller than the placeholder.
77+
border-radius: $timeline-image-border-radius;
78+
}
79+
}
6980
}
7081

7182
.mx_MImageBody_thumbnail {

0 commit comments

Comments
 (0)