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

Specify spacing around EventTileBubble for each layout #9001

Merged
merged 4 commits into from
Jul 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 9 additions & 17 deletions res/css/views/messages/_EventTileBubble.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,58 +16,50 @@ limitations under the License.

.mx_EventTileBubble {
background-color: $dark-panel-bg-color;
padding: 10px;
padding: 10px; // TODO: Use a spacing variable
border-radius: 8px;
margin: 10px auto;
// Reserve space for external timestamps, but also cap the width
max-width: min(calc(100% - 2 * $MessageTimestamp_width), 600px);
box-sizing: border-box;
display: grid;
grid-template-columns: 24px minmax(0, 1fr) min-content min-content;

.mx_EventTile[data-layout=bubble] & {
// Timestamps are inside the tile, so the width can be less constrained
max-width: 600px;
}

&::before, &::after {
&::before,
&::after {
position: relative;
grid-column: 1;
grid-row: 1 / 3;
width: 16px;
height: 16px;
content: "";
top: 0;
bottom: 0;
left: 0;
right: 0;
inset: 0;
mask-repeat: no-repeat;
mask-position: center;
mask-size: contain;
margin-top: 4px;
margin-top: $spacing-4;
}

.mx_EventTileBubble_title, .mx_EventTileBubble_subtitle {
.mx_EventTileBubble_title,
.mx_EventTileBubble_subtitle {
grid-column: 2;
overflow-wrap: break-word;
}

.mx_EventTileBubble_title {
font-weight: 600;
font-size: $font-15px;
grid-column: 2;
grid-row: 1;
}

.mx_EventTileBubble_subtitle {
font-size: $font-12px;
grid-column: 2;
grid-row: 2;
}

.mx_MessageTimestamp {
grid-column: 4;
grid-row: 1 / 3;
align-self: center;
margin-left: 16px;
margin-left: $spacing-16;
}
}
27 changes: 27 additions & 0 deletions res/css/views/rooms/_EventTile.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ $left-gutter: 64px;
}
}

.mx_EventTileBubble {
margin-block: 10px; // TODO: Use a spacing variable
}

.mx_MImageBody {
.mx_MImageBody_thumbnail_container {
display: flex;
Expand Down Expand Up @@ -217,10 +221,28 @@ $left-gutter: 64px;
}
}

&[data-layout=bubble],
&[data-layout=group] {
.mx_EventTileBubble {
margin-inline: auto;
}
}

&[data-layout=irc] {
--EventTile_irc_line_info-inset-inline-start: calc(var(--name-width) + 10px + var(--icon-width));

.mx_MessageTimestamp {
text-align: right;
}

.mx_EventTileBubble {
position: relative;
left: var(--EventTile_irc_line_info-inset-inline-start);
}

.mx_ReplyTile .mx_EventTileBubble {
left: unset; // Cancel the value specified above for the tile inside ReplyTile
}
}

&[data-layout=group] {
Expand Down Expand Up @@ -306,6 +328,11 @@ $left-gutter: 64px;
}

&[data-layout=bubble] {
.mx_EventTileBubble {
// Timestamps are inside the tile, so the width can be less constrained
max-width: 600px;
}

&.mx_EventTile_continuation {
margin-top: 2px;
}
Expand Down
4 changes: 2 additions & 2 deletions res/css/views/rooms/_IRCLayout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,13 @@ $irc-line-height: $font-18px;

.mx_EventTile.mx_EventTile_info {
.mx_EventTile_avatar {
left: calc(var(--name-width) + 10px + var(--icon-width));
left: var(--EventTile_irc_line_info-inset-inline-start);
top: 0;
margin-right: var(--right-padding);
}

.mx_EventTile_line {
left: calc(var(--name-width) + 10px + var(--icon-width));
left: var(--EventTile_irc_line_info-inset-inline-start);
}

.mx_TextualEvent {
Expand Down