Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 5446d5d

Browse files
authored
Fix position of wide images on IRC / modern layout (#8667)
* Move declarations related to position from _MImageBody.scss to _EventTile.scss These declarations should not be defined as default values as position depends on other factors such as layout, etc. Signed-off-by: Suguru Hirahara <[email protected]> * Move min-height and min-width declarations from _MImageBody.scss to _EventTile.scss Since min-height and min-width have been specified for bubble layout, the declarations have been expected to be applied to the other layouts. Signed-off-by: Suguru Hirahara <[email protected]> * Apply 'justify-content: center' to bubble layout only 'justify-content: center' was added for the bubble layout with 1436f23. It should not be applied to the other layouts. In order to prevent an issue related to cascading from happening, 'justify-content: flex-start' is explicitly specified. Signed-off-by: Suguru Hirahara <[email protected]> * yarn run lint:style --fix Signed-off-by: Suguru Hirahara <[email protected]>
1 parent 11cb481 commit 5446d5d

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

res/css/views/messages/_MImageBody.scss

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,6 @@ $timeline-image-border-radius: 8px;
6262
overflow: hidden;
6363
contain: paint;
6464

65-
min-height: $font-44px;
66-
min-width: $font-44px;
67-
display: flex;
68-
justify-content: center;
69-
align-items: center;
70-
7165
// Override inline max-width value to avoid overflow
7266
max-width: 100% !important;
7367

res/css/views/rooms/_EventBubbleTile.scss

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,12 @@ limitations under the License.
156156
padding-right: 48px;
157157
}
158158

159-
.mx_MImageBody_thumbnail_container {
160-
min-height: calc(1.8rem + var(--gutterSize) + var(--gutterSize));
161-
min-width: calc(1.8rem + var(--gutterSize) + var(--gutterSize));
159+
.mx_MImageBody {
160+
.mx_MImageBody_thumbnail_container {
161+
justify-content: center;
162+
min-height: calc(1.8rem + var(--gutterSize) + var(--gutterSize));
163+
min-width: calc(1.8rem + var(--gutterSize) + var(--gutterSize));
164+
}
162165
}
163166

164167
.mx_CallEvent {

res/css/views/rooms/_EventTile.scss

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,13 @@ $threadInfoLineHeight: calc(2 * $font-12px); // See: _commons.scss
5858
}
5959
}
6060

61+
.mx_MImageBody {
62+
.mx_MImageBody_thumbnail_container {
63+
display: flex;
64+
align-items: center; // on every layout
65+
}
66+
}
67+
6168
&[data-layout=group] {
6269
.mx_EventTile_line {
6370
line-height: var(--GroupLayout-EventTile-line-height);
@@ -265,6 +272,12 @@ $threadInfoLineHeight: calc(2 * $font-12px); // See: _commons.scss
265272

266273
.mx_MImageBody {
267274
margin-right: 34px;
275+
276+
.mx_MImageBody_thumbnail_container {
277+
justify-content: flex-start;
278+
min-height: $font-44px;
279+
min-width: $font-44px;
280+
}
268281
}
269282

270283
.mx_EventTile_e2eIcon {

0 commit comments

Comments
 (0)