element-web-Github/res/css/views/rooms/_EventBubbleTile.scss

408 lines
9.5 KiB
SCSS
Raw Normal View History

/*
Copyright 2021 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
.mx_EventTile[data-layout=bubble],
.mx_EventListSummary[data-layout=bubble] {
--avatarSize: 32px;
2021-07-05 22:22:18 +08:00
--gutterSize: 11px;
2021-07-01 00:04:07 +08:00
--cornerRadius: 12px;
--maxWidth: 70%;
}
.mx_EventTile[data-layout=bubble] {
position: relative;
margin-top: var(--gutterSize);
margin-left: 49px;
2021-07-07 21:13:58 +08:00
margin-right: 100px;
font-size: $font-14px;
2021-07-07 17:23:38 +08:00
.mx_ThreadInfo {
clear: both;
width: fit-content;
}
2021-07-07 17:23:38 +08:00
&.mx_EventTile_continuation {
margin-top: 2px;
}
&.mx_EventTile_highlight {
&::before {
background-color: $event-highlight-bg-color;
}
Color cleanup number six (#7050) * Remove $voip-decline-color and $voip-accept-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Remove $dialog-background-bg-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $mention-user-pill-bg-color -> $warning-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $plinth-bg-color -> $secondary-accent-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $input-lighter-fg-color -> $input-darker-fg-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $input-valid-border-color -> $accent-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $input-invalid-border-color -> $warning-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $button-bg-color -> $accent-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $avatar-bg-color -> $background Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $preview-widget-fg-color -> $greyed-fg-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $settings-profile-button-fg-color -> $settings-profile-overlay-placeholder-fg-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $presence-online -> $accent-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $pinned-unread-color -> $notice-primary-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $event-highlight-fg-color -> $warning-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $tab-label-active-bg-color -> $accent-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $button-primary-bg-color -> $accent-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $button-danger-bg-color -> $notice-primary-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $button-link-fg-color -> $accent-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $togglesw-on-color -> $accent-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $slider-selection-color -> $accent-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $progressbar-fg-color -> $accent-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $authpage-body-bg-color -> $background Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Fix merge issue Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Fix second merge issue Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
2021-11-08 19:50:53 +08:00
color: $warning-color;
}
2021-07-01 21:23:00 +08:00
/* For replies */
.mx_EventTile {
padding-top: 0;
}
2021-07-29 17:12:07 +08:00
&::before {
content: '';
position: absolute;
top: -1px;
bottom: -1px;
left: -60px;
right: -60px;
z-index: -1;
border-radius: 4px;
}
&:hover,
&.mx_EventTile_selected {
2021-07-29 17:12:07 +08:00
2021-07-07 17:23:38 +08:00
&::before {
background: $eventbubble-bg-hover;
}
.mx_EventTile_avatar {
img {
box-shadow: 0 0 0 3px $eventbubble-bg-hover;
}
}
}
.mx_SenderProfile,
.mx_EventTile_line {
width: fit-content;
max-width: 70%;
}
> .mx_SenderProfile {
2021-07-07 21:13:58 +08:00
position: relative;
top: -2px;
left: 2px;
font-size: $font-15px;
}
2021-07-07 19:00:31 +08:00
&[data-self=false] {
.mx_EventTile_line {
border-bottom-right-radius: var(--cornerRadius);
.mx_MImageBody .mx_MImageBody_thumbnail {
border-bottom-right-radius: var(--cornerRadius);
}
2021-07-07 19:00:31 +08:00
}
2021-07-07 19:15:25 +08:00
.mx_EventTile_avatar {
left: -34px;
2021-07-07 19:15:25 +08:00
}
.mx_MessageActionBar {
right: 0;
transform: translate3d(90%, 50%, 0);
2021-07-07 19:15:25 +08:00
}
--backgroundColor: $eventbubble-others-bg;
2021-07-07 19:00:31 +08:00
}
&[data-self=true] {
.mx_EventTile_line {
float: right;
border-bottom-left-radius: var(--cornerRadius);
2021-07-07 19:15:25 +08:00
> a {
left: auto;
right: -68px;
2021-07-07 19:15:25 +08:00
}
.mx_MImageBody .mx_MImageBody_thumbnail {
border-bottom-left-radius: var(--cornerRadius);
}
2021-07-07 19:15:25 +08:00
}
.mx_ThreadInfo {
float: right;
margin-right: calc(-1 * var(--gutterSize));
}
2021-07-07 19:15:25 +08:00
.mx_SenderProfile {
display: none;
}
.mx_ReplyTile .mx_SenderProfile {
display: block;
}
2021-07-07 19:15:25 +08:00
.mx_ReactionsRow {
float: right;
clear: right;
display: flex;
/* Moving the "add reaction button" before the reactions */
> :last-child {
order: -1;
}
2021-07-07 19:00:31 +08:00
}
2021-07-07 19:15:25 +08:00
.mx_EventTile_avatar {
top: -19px; // height of the sender block
2021-07-07 21:13:58 +08:00
right: -35px;
2021-07-07 19:15:25 +08:00
}
--backgroundColor: $eventbubble-self-bg;
2021-07-07 19:00:31 +08:00
}
.mx_EventTile_line {
2021-07-07 18:04:28 +08:00
position: relative;
2021-07-01 00:04:07 +08:00
display: flex;
2021-07-07 21:13:58 +08:00
gap: 5px;
margin: 0 -12px 0 -9px;
border-top-left-radius: var(--cornerRadius);
border-top-right-radius: var(--cornerRadius);
2021-07-01 00:04:07 +08:00
> a {
position: absolute;
padding: 10px 20px;
top: 0;
left: -68px;
2021-07-01 00:04:07 +08:00
}
//noinspection CssReplaceWithShorthandSafely
.mx_MImageBody .mx_MImageBody_thumbnail {
// Note: This is intentionally not compressed because the browser gets confused
// when it is all combined. We're effectively unsetting the border radius then
// setting the two corners we care about manually.
border-radius: unset;
border-top-left-radius: var(--cornerRadius);
border-top-right-radius: var(--cornerRadius);
}
}
.mx_EventTile_line:not(.mx_EventTile_mediaLine) {
padding: var(--gutterSize);
background: var(--backgroundColor);
}
2021-07-07 19:00:31 +08:00
&.mx_EventTile_continuation[data-self=false] .mx_EventTile_line {
2021-07-07 18:04:28 +08:00
border-top-left-radius: 0;
.mx_MImageBody .mx_MImageBody_thumbnail {
border-top-left-radius: 0;
}
2021-07-07 18:04:28 +08:00
}
2021-07-07 19:00:31 +08:00
&.mx_EventTile_lastInSection[data-self=false] .mx_EventTile_line {
2021-07-07 18:04:28 +08:00
border-bottom-left-radius: var(--cornerRadius);
.mx_MImageBody .mx_MImageBody_thumbnail {
border-bottom-left-radius: var(--cornerRadius);
}
2021-07-07 18:04:28 +08:00
}
2021-07-07 19:00:31 +08:00
&.mx_EventTile_continuation[data-self=true] .mx_EventTile_line {
border-top-right-radius: 0;
.mx_MImageBody .mx_MImageBody_thumbnail {
border-top-right-radius: 0;
}
2021-07-07 19:00:31 +08:00
}
&.mx_EventTile_lastInSection[data-self=true] .mx_EventTile_line {
border-bottom-right-radius: var(--cornerRadius);
.mx_MImageBody .mx_MImageBody_thumbnail {
border-bottom-right-radius: var(--cornerRadius);
}
2021-07-07 19:00:31 +08:00
}
2021-07-07 18:04:28 +08:00
.mx_EventTile_avatar {
position: absolute;
top: 0;
line-height: 1;
2021-07-23 18:12:52 +08:00
z-index: 9;
img {
box-shadow: 0 0 0 3px $background;
border-radius: 50%;
}
}
&.mx_EventTile_noSender {
.mx_EventTile_avatar {
top: -19px;
}
}
2021-07-23 20:17:26 +08:00
.mx_BaseAvatar,
.mx_EventTile_avatar {
line-height: 1;
}
&[data-has-reply=true] {
> .mx_EventTile_line {
flex-direction: column;
}
.mx_ReplyChain_show {
order: 99999;
}
2021-07-01 00:04:07 +08:00
.mx_ReplyChain {
2021-07-01 00:04:07 +08:00
.mx_EventTile_reply {
max-width: 90%;
2021-07-01 00:04:07 +08:00
padding: 0;
> a {
display: none !important;
}
}
.mx_EventTile {
display: flex;
gap: var(--gutterSize);
.mx_EventTile_avatar {
position: static;
}
.mx_SenderProfile {
display: none;
}
}
}
}
.mx_EditMessageComposer_buttons {
position: static;
padding: 0;
margin: 8px 0 0;
background: transparent;
}
.mx_ReactionsRow {
margin-right: -18px;
margin-left: -9px;
}
/* Special layout scenario for "Unable To Decrypt (UTD)" events */
&.mx_EventTile_bad > .mx_EventTile_line {
2021-07-07 21:13:58 +08:00
display: grid;
grid-template:
"reply reply" auto
"shield body" auto
"shield link" auto
/ auto 1fr;
.mx_EventTile_e2eIcon {
grid-area: shield;
}
.mx_UnknownBody {
grid-area: body;
}
.mx_EventTile_keyRequestInfo {
grid-area: link;
}
.mx_ReplyChain_wrapper {
2021-07-07 21:13:58 +08:00
grid-area: reply;
}
}
.mx_EventTile_readAvatars {
position: absolute;
2021-07-07 21:13:58 +08:00
right: -110px;
bottom: 0;
2021-07-01 00:04:07 +08:00
top: auto;
}
.mx_MTextBody {
max-width: 100%;
}
}
.mx_EventTile.mx_EventTile_bubbleContainer[data-layout=bubble],
.mx_EventTile.mx_EventTile_leftAlignedBubble[data-layout=bubble],
.mx_EventTile.mx_EventTile_info[data-layout=bubble],
.mx_EventListSummary[data-layout=bubble][data-expanded=false] {
--backgroundColor: transparent;
--gutterSize: 0;
display: flex;
align-items: center;
justify-content: flex-start;
padding: 5px 0;
.mx_EventTile_avatar {
position: static;
order: -1;
margin-right: 5px;
}
.mx_EventTile_line,
.mx_EventTile_info {
min-width: 100%;
// Preserve alignment with left edge of text in bubbles
margin: 0;
}
2021-07-30 15:19:34 +08:00
.mx_EventTile_e2eIcon {
margin-left: 9px;
}
.mx_EventTile_line > a {
// Align timestamps with those of normal bubble tiles
right: auto;
top: -11px;
left: -95px;
}
}
.mx_EventListSummary[data-layout=bubble] {
--maxWidth: 70%;
margin-left: calc(var(--avatarSize) + var(--gutterSize));
margin-right: 94px;
.mx_EventListSummary_toggle {
float: none;
margin: 0;
order: 9;
margin-left: 5px;
margin-right: 55px;
}
.mx_EventListSummary_avatars {
padding-top: 0;
}
&::after {
content: "";
clear: both;
}
.mx_EventTile {
margin: 0 6px;
padding: 2px 0;
}
.mx_EventTile_line {
margin: 0;
> a {
// Align timestamps with those of normal bubble tiles
left: -76px;
}
}
.mx_MessageActionBar {
transform: translate3d(90%, 0, 0);
}
}
.mx_EventListSummary[data-expanded=false][data-layout=bubble] {
// Align with left edge of bubble tiles
padding: 0 49px;
}
/* events that do not require bubble layout */
.mx_EventListSummary[data-layout=bubble],
.mx_EventTile.mx_EventTile_bad[data-layout=bubble] {
.mx_EventTile_line {
background: transparent;
}
&:hover {
&::before {
background: transparent;
}
}
}