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

Commit

Permalink
Fix position of wide images on IRC / modern layout (#8667)
Browse files Browse the repository at this point in the history
* 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 <luixxiul@users.noreply.github.com>

* 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 <luixxiul@users.noreply.github.com>

* 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 <luixxiul@users.noreply.github.com>

* yarn run lint:style --fix

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
  • Loading branch information
luixxiul committed May 23, 2022
1 parent 11cb481 commit 5446d5d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
6 changes: 0 additions & 6 deletions res/css/views/messages/_MImageBody.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,6 @@ $timeline-image-border-radius: 8px;
overflow: hidden;
contain: paint;

min-height: $font-44px;
min-width: $font-44px;
display: flex;
justify-content: center;
align-items: center;

// Override inline max-width value to avoid overflow
max-width: 100% !important;

Expand Down
9 changes: 6 additions & 3 deletions res/css/views/rooms/_EventBubbleTile.scss
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,12 @@ limitations under the License.
padding-right: 48px;
}

.mx_MImageBody_thumbnail_container {
min-height: calc(1.8rem + var(--gutterSize) + var(--gutterSize));
min-width: calc(1.8rem + var(--gutterSize) + var(--gutterSize));
.mx_MImageBody {
.mx_MImageBody_thumbnail_container {
justify-content: center;
min-height: calc(1.8rem + var(--gutterSize) + var(--gutterSize));
min-width: calc(1.8rem + var(--gutterSize) + var(--gutterSize));
}
}

.mx_CallEvent {
Expand Down
13 changes: 13 additions & 0 deletions res/css/views/rooms/_EventTile.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ $threadInfoLineHeight: calc(2 * $font-12px); // See: _commons.scss
}
}

.mx_MImageBody {
.mx_MImageBody_thumbnail_container {
display: flex;
align-items: center; // on every layout
}
}

&[data-layout=group] {
.mx_EventTile_line {
line-height: var(--GroupLayout-EventTile-line-height);
Expand Down Expand Up @@ -265,6 +272,12 @@ $threadInfoLineHeight: calc(2 * $font-12px); // See: _commons.scss

.mx_MImageBody {
margin-right: 34px;

.mx_MImageBody_thumbnail_container {
justify-content: flex-start;
min-height: $font-44px;
min-width: $font-44px;
}
}

.mx_EventTile_e2eIcon {
Expand Down

0 comments on commit 5446d5d

Please sign in to comment.