Files
ThreadNet-Web/res/css/views/rooms/_EventTile.pcss
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

1386 lines
38 KiB
Plaintext
Raw Normal View History

/*
2024-09-09 14:57:16 +01:00
Copyright 2024 New Vector Ltd.
Copyright 2020, 2021 The Matrix.org Foundation C.I.C.
Copyright 2015, 2016 OpenMarket Ltd
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
2024-09-09 14:57:16 +01:00
Please see LICENSE files in the repository root for full details.
*/
$left-gutter: 64px;
.mx_EventTile {
--EventTile_content-margin-inline-end: 34px;
--EventTile_group_line-spacing-block-start: 1px;
--EventTile_group_line-spacing-block-end: 3px;
--EventTile_group_line-spacing-inline-start: $left-gutter;
--EventTile_group_line-line-height: $font-22px;
--EventTile_ThreadSummary-line-height: calc(2 * $font-12px);
flex-shrink: 0;
max-width: 100%;
clear: both; /* TODO: check if this is necessary */
padding-top: 18px;
position: relative;
&.mx_EventTile_info {
font-size: var(--cpd-font-size-body-sm);
color: $secondary-content;
}
.mx_EventTile_avatar {
cursor: pointer;
user-select: none;
}
.mx_EventTile_body {
overflow-y: hidden;
2024-07-31 23:23:46 +01:00
text-align: start;
}
.mx_ReadReceiptGroup_container svg {
display: inline-block;
2022-04-22 17:09:44 +02:00
width: 16px;
height: 16px;
color: var(--cpd-color-icon-tertiary);
}
.mx_EventTile_content {
&.mx_EditMessageComposer,
&.mx_EditWysiwygComposer {
/* Make sure the formatting bar is visible */
overflow: visible;
}
}
.mx_EventTile_searchHighlight {
background-color: $accent;
color: $accent-fg-color;
border-radius: 5px;
padding-inline: 2px;
cursor: pointer;
a {
background-color: $accent;
color: $accent-fg-color;
}
}
.mx_EventTileBubble {
margin-block: var(--EventTileBubble_margin-block);
min-width: 100px;
}
.mx_MImageBody {
.mx_MImageBody_thumbnail_container {
display: flex;
align-items: center; /* on every layout */
}
}
.mx_DisambiguatedProfile {
color: $primary-content;
2023-06-29 11:30:25 +01:00
font: var(--cpd-font-body-md-regular);
display: inline-block;
padding-bottom: 0px;
padding-top: 0px;
}
.mx_ReactionsRow {
display: flex;
flex-flow: wrap;
align-items: center;
gap: $spacing-4;
}
.mx_ReplyChain--expanded {
.mx_EventTile_body {
/* !important needed to override .mx_ReplyTile .mx_EventTile_content .mx_EventTile_body */
display: block !important;
overflow-y: scroll;
}
.mx_EventTile_collapsedCodeBlock {
/* !important needed due to .mx_ReplyTile .mx_EventTile_content .mx_EventTile_pre_container > pre */
2022-07-15 14:53:23 +01:00
display: block !important;
}
}
.mx_RoomView_searchResultsPanel & {
&.mx_EventTile_contextual {
opacity: 0.4;
}
}
&.mx_EventTile_bubbleContainer {
display: grid;
grid-template-columns: 1fr 100px;
.mx_EventTile_line {
margin-right: 0;
grid-column: 1 / 3;
padding: 0 !important; /* override default padding of mx_EventTile_line so that we can be centered */
}
.mx_EventTile_msgOption {
grid-column: 2;
}
&:hover {
.mx_EventTile_line {
/* To avoid bubble events being highlighted */
background-color: inherit !important;
}
}
}
&.mx_EventTile_isEditing .mx_MessageTimestamp {
visibility: hidden;
}
2022-07-15 14:53:23 +01:00
&[data-layout="irc"],
&[data-layout="group"] {
--selected-message-border-width: 4px;
/* TODO: adjust the values for IRC layout */
--EventTile-box-shadow-offset-x: calc(50px + var(--selected-message-border-width));
--EventTile-box-shadow-spread-radius: -50px;
.mx_EventTile_e2eIcon {
position: absolute;
}
.mx_MImageBody {
.mx_MImageBody_thumbnail_container {
justify-content: flex-start;
min-height: $font-44px;
min-width: $font-44px;
}
}
.mx_EventTile_line,
.mx_EventTile_reply {
position: relative;
border-radius: 8px;
}
.mx_EventTile_reply {
margin-right: 10px;
}
.mx_EventTile_msgOption {
float: right;
text-align: right;
position: relative;
width: 90px;
/* Hack to stop the height of this pushing the messages apart.
Replaces margin-top: -6px. This interacts better with a read
marker being in between. Content overflows. */
height: 1px;
}
&.mx_EventTile_highlight,
&.mx_EventTile_highlight .markdown-body {
.mx_EventTile_line {
background-color: $event-highlight-bg-color;
}
}
2023-09-28 12:52:26 +01:00
&:focus-visible:focus-within,
&.mx_EventTile_actionBarFocused,
&.mx_EventTile_isEditing,
&.mx_EventTile_selected {
.mx_EventTile_line {
background-color: $event-selected-color;
}
}
/* this is used for the tile for the event which is selected via the URL. */
&.mx_EventTile_isEditing,
&.mx_EventTile_selected {
> .mx_EventTile_line {
/* TODO: ultimately we probably want some transition on here. */
2022-07-15 14:53:23 +01:00
box-shadow: inset var(--EventTile-box-shadow-offset-x) 0 0 var(--EventTile-box-shadow-spread-radius)
var(--cpd-color-bg-action-primary-rest);
}
}
&.mx_EventTile_info {
.mx_EventTile_e2eIcon {
top: 0;
}
}
&.mx_EventTile_continuation .mx_EventTile_line {
clear: both;
}
&:hover {
.mx_EventTile_line {
background-color: $event-selected-color;
}
}
}
2022-07-15 14:53:23 +01:00
&[data-layout="bubble"],
&[data-layout="group"] {
.mx_EventTileBubble {
margin-inline: auto;
}
.mx_ReplyChain {
margin-bottom: $spacing-8;
}
}
2022-07-15 14:53:23 +01:00
&[data-layout="irc"] {
--EventTile_irc_line-padding-block: 1px;
/* add --right-padding value of MessageTimestamp only */
/* stylelint-disable-next-line declaration-colon-space-after */
--EventTile_irc_line_info-margin-inline-start: calc(
var(--name-width) + var(--icon-width) + 1 * var(--right-padding)
);
display: flex;
align-items: flex-start;
padding-top: 0;
.mx_MessageTimestamp {
min-width: var(--MessageTimestamp-width); /* ensure space for EventTile without timestamp */
text-align: right;
}
> * {
margin-right: var(--right-padding);
}
.mx_EventTile_avatar,
.mx_EventTile_e2eIcon {
height: var(--irc-line-height);
}
.mx_EventTile_avatar,
.mx_DisambiguatedProfile,
.mx_EventTile_e2eIcon,
.mx_EventTile_msgOption {
flex-shrink: 0;
}
.mx_EventTile_avatar {
order: 1;
position: relative;
display: flex;
align-items: center;
2025-12-02 09:57:28 +00:00
/* Need to use important to override the js calculated values. */
> .mx_BaseAvatar,
> .mx_BaseAvatar > * {
font-size: $font-10px !important;
2025-12-02 09:57:28 +00:00
line-height: calc($font-15px - 2px) !important;
}
}
.mx_DisambiguatedProfile {
order: 2;
width: var(--name-width);
margin-inline-end: 0; /* override mx_EventTile > * */
> .mx_DisambiguatedProfile_displayName {
width: 100%;
text-align: end;
overflow: hidden;
text-overflow: ellipsis;
}
> .mx_DisambiguatedProfile_mxid {
visibility: collapse;
margin-left: 0; /* Override the inherited margin. */
padding: 0 5px;
}
&:hover {
overflow: visible;
z-index: 10;
> .mx_DisambiguatedProfile_displayName {
overflow: visible;
display: inline;
background-color: $event-selected-color;
border-radius: 8px 0 0 8px;
padding-right: $spacing-8;
}
> .mx_DisambiguatedProfile_mxid {
visibility: visible;
opacity: 1;
background-color: $event-selected-color;
}
}
}
.mx_EventTile_e2eIcon {
padding: 0;
flex-grow: 0;
background-position: center;
}
.mx_EventTile_line {
.mx_EventTile_e2eIcon,
.mx_TextualEvent,
.mx_ViewSourceEvent,
.mx_MTextBody {
/* add a 1px padding top and bottom because our larger
emoji font otherwise gets cropped by anti-zalgo */
padding: var(--EventTile_irc_line-padding-block) 0;
}
.mx_EventTile_e2eIcon,
.mx_TextualEvent,
.mx_MTextBody {
display: inline-block;
}
.mx_ReplyTile {
.mx_MTextBody {
display: -webkit-box; /* Enable -webkit-line-clamp */
}
}
}
.mx_EventTile_line,
.mx_EventTile_reply {
order: 3;
display: flex;
flex-direction: column;
flex-grow: 1;
flex-shrink: 1;
min-width: 0;
}
.mx_EventTile_reply {
order: 4;
}
.mx_EventTile_msgOption {
order: 5;
.mx_ReadReceiptGroup {
inset-block-start: -0.3rem; /* (var(--irc-line-height) - avatar height) / 2 */
}
}
.mx_ReplyChain {
margin: 0;
}
.mx_EditMessageComposer_buttons {
position: relative;
}
.mx_EventTileBubble {
position: relative;
left: var(--EventTile_irc_line_info-margin-inline-start);
&.mx_cryptoEvent {
left: unset;
}
}
.mx_ReplyTile .mx_EventTileBubble {
left: unset; /* Cancel the value specified above for the tile inside ReplyTile */
}
&.mx_EventTile_isEditing > .mx_EventTile_line {
.mx_EditMessageComposer {
/* add space for the stroke on box-shadow */
padding-inline-start: calc(
var(--selected-message-border-width) + var(--EditMessageComposer-padding-inline)
);
}
}
&.mx_EventTile_info {
.mx_EventTile_avatar {
left: var(--EventTile_irc_line_info-margin-inline-start);
top: 0;
margin-right: var(--right-padding);
padding-block: var(--EventTile_irc_line-padding-block);
}
.mx_EventTile_line {
margin-inline-start: var(--EventTile_irc_line_info-margin-inline-start);
}
.mx_ViewSourceEvent, /* For hidden events */
.mx_TextualEvent {
line-height: var(--irc-line-height);
}
}
&.mx_EventTile_emote {
.mx_EventTile_avatar {
/* add --right-padding value of MessageTimestamp only */
margin-left: calc(var(--name-width) + var(--icon-width) + 1 * var(--right-padding));
}
}
.mx_EventTile_footer {
margin: var(--cpd-space-1-5x) 0;
}
}
2022-07-15 14:53:23 +01:00
&[data-layout="group"] {
.mx_EventTile_avatar {
top: 14px;
left: $spacing-8;
}
.mx_EventTile_line,
.mx_EventTile_reply {
padding-top: var(--EventTile_group_line-spacing-block-start);
padding-bottom: var(--EventTile_group_line-spacing-block-end);
padding-left: var(--EventTile_group_line-spacing-inline-start);
line-height: var(--EventTile_group_line-line-height);
}
.mx_EventTile_e2eIcon {
inset: 0 0 0 44px;
2024-01-02 18:56:39 +00:00
/* Keep height equal to text for alignment */
height: var(--EventTile_group_line-line-height);
margin: 1px;
}
.mx_EventTile_msgOption {
margin-inline-end: 10px;
.mx_ReadReceiptGroup {
/* This aligns the avatar with the last line of the */
/* message. We want to move it one line up */
/* See .mx_EventTile[data-layout=group] .mx_EventTile_line in _EventTile.scss */
inset-block-start: calc(-$font-22px - 3px);
}
}
.mx_MessageTimestamp {
position: absolute;
left: 0;
text-align: center;
}
.mx_ThreadSummary,
.mx_ThreadSummary_icon {
margin-left: $left-gutter;
}
.mx_EventTile_footer {
margin: var(--cpd-space-1x) var(--EventTile_group_line-spacing-inline-start);
}
> .mx_DisambiguatedProfile {
line-height: $font-20px;
margin-left: $left-gutter;
max-width: calc(100% - $left-gutter);
}
> .mx_EventTile_avatar {
position: absolute;
z-index: 9;
}
.mx_RoomView_timeline_rr_enabled & {
$inline-end-margin: 80px;
.mx_ThreadSummary,
.mx_ThreadSummary_icon,
.mx_EventTile_line {
margin-right: $inline-end-margin;
min-height: $font-14px;
}
.mx_ThreadSummary {
/* leave space on both left & right gutters */
2022-07-15 14:53:23 +01:00
max-width: min(calc(100% - $left-gutter - $inline-end-margin), 600px);
}
/* on ELS we need the margin to allow interaction with the expand/collapse button */
/* which is normally in the RR gutter */
}
&.mx_EventTile_continuation {
padding-top: 0;
}
&.mx_EventTile_info {
$spacing-block-start: 3px;
$spacing-block-end: 2px;
padding-top: 0;
.mx_EventTile_avatar,
.mx_EventTile_e2eIcon {
line-height: 1;
margin: $spacing-block-start 0 $spacing-block-end;
}
.mx_EventTile_avatar {
top: initial;
inset-inline-start: $left-gutter;
height: 14px;
}
.mx_EventTile_line {
padding-block: $spacing-block-start $spacing-block-end;
/* 20px: avatar area */
2022-07-15 14:53:23 +01:00
padding-inline-start: calc(var(--EventTile_group_line-spacing-inline-start) + 20px);
.mx_MessageTimestamp {
top: 0;
}
}
&.mx_EventTile_selected .mx_EventTile_line {
/* TODO: check if this would be necessary; */
padding-inline-start: calc(var(--EventTile_group_line-spacing-inline-start) + 20px);
}
}
}
2022-07-15 14:53:23 +01:00
&[data-layout="bubble"] {
/* Other half of the gutter is provided by margin-bottom on the last tile
of the section */
margin-top: calc(var(--gutterSize) / 2);
margin-left: var(--EventTile_bubble-margin-inline-start);
/* Reset default values. TODO: remove */
max-width: unset;
padding-top: 0;
.mx_EventTile_msgOption {
.mx_ReadReceiptGroup {
position: absolute;
inset-block-start: auto;
/* as close to right gutter without clipping as possible */
inset-inline-end: calc(-1 * var(--ReadReceiptGroup_EventBubbleTile-spacing-end));
/* (EventTileLine.line-height - ReadReceiptGroup.height) / 2 */
/* this centers the ReadReceiptGroup if weve got a single line */
inset-block-end: calc(($font-18px - 24px) / 2);
}
}
.mx_EventTileBubble {
/* Timestamps are inside the tile, so the width can be less constrained */
max-width: 600px;
}
&.mx_EventTile_continuation {
margin-top: 2px;
}
&.mx_EventTile_lastInSection {
/* Other half of the gutter is provided by margin-top on the first
tile of the section */
margin-bottom: calc(var(--gutterSize) / 2);
}
}
}
.mx_GenericEventListSummary {
2022-07-15 14:53:23 +01:00
&[data-layout="irc"],
&[data-layout="group"] {
.mx_EventTile_line .mx_RedactedBody {
line-height: 1; /* remove spacing between lines */
}
}
2022-07-15 14:53:23 +01:00
&[data-layout="irc"] {
/* Apply only collapsed events block */
> .mx_EventTile_line {
/* add --right-padding value of MessageTimestamp and avatar only */
2022-07-15 14:53:23 +01:00
/* stylelint-disable-next-line declaration-colon-space-after */
padding-left: calc(
var(--name-width) + var(--icon-width) + var(--MessageTimestamp-width) + 2 * var(--right-padding)
2022-07-15 14:53:23 +01:00
);
}
}
2022-07-15 14:53:23 +01:00
&[data-layout="group"] {
.mx_EventTile_line {
padding-left: $left-gutter;
}
.mx_GenericEventListSummary_unstyledList > .mx_EventTile_info .mx_EventTile_avatar ~ .mx_EventTile_line {
/* override padding-left $left-gutter */
padding-inline-start: calc(var(--EventTile_group_line-spacing-inline-start) + 20px);
}
}
}
2021-07-21 11:41:52 +02:00
.mx_EventTile_content {
/*
all the overflow-y: hidden; are to trap Zalgos -
but they introduce an implicit overflow-x: auto.
so make that explicitly hidden too to avoid random
horizontal scrollbars occasionally appearing, like in
https://github.com/vector-im/vector-web/issues/1154
*/
2021-07-21 11:41:52 +02:00
overflow-y: hidden;
overflow-x: hidden;
margin-right: var(--EventTile_content-margin-inline-end);
.mx_EventTile_edited,
.mx_EventTile_pendingModeration {
user-select: none;
font-size: $font-12px;
2023-07-12 18:46:49 +01:00
color: $secondary-content;
display: inline-block;
2024-07-31 23:23:46 +01:00
margin-inline-start: 9px;
}
.mx_EventTile_edited {
cursor: pointer;
}
.markdown-body {
2023-06-29 11:30:25 +01:00
font: var(--cpd-font-body-md-regular) !important;
letter-spacing: var(--cpd-font-letter-spacing-body-md);
2023-07-03 16:07:30 +01:00
font-family: inherit !important;
white-space: normal !important;
line-height: inherit !important;
background-color: inherit;
color: inherit; /* inherit the colour from the dark or light theme by default (but not for code blocks) */
2025-03-03 10:17:41 +01:00
flex: 1;
pre,
code {
font-family: $monospace-font-family !important;
2023-01-19 15:49:21 +00:00
background-color: $system;
}
2023-01-19 14:42:59 +01:00
code:not(pre *) {
background-color: $inlinecode-background-color;
border: 1px solid $inlinecode-border-color;
border-radius: 4px;
/* The horizontal padding is added by github-markdown-css .markdown-body */
2023-01-19 14:42:59 +01:00
padding: $spacing-2 0;
2024-01-02 18:56:39 +00:00
/* Avoid inline code blocks to be sticked when on multiple lines */
2023-01-19 14:42:59 +01:00
line-height: $font-22px;
2024-01-02 18:56:39 +00:00
/* Avoid the border to be glued to the other words */
2023-01-19 14:42:59 +01:00
margin-right: $spacing-2;
}
code {
white-space: pre-wrap; /* don't collapse spaces in inline code blocks */
}
pre {
/* have to use overlay rather than auto otherwise Linux and Windows */
/* Chrome gets very confused about vertical spacing: */
/* https://github.com/vector-im/vector-web/issues/754 */
overflow-x: overlay;
overflow-y: visible;
&::-webkit-scrollbar-corner {
background: transparent;
}
2023-01-19 15:49:21 +00:00
border: 1px solid $quinary-content;
code {
white-space: pre; /* we want code blocks to be scrollable and not wrap */
> * {
display: inline;
}
}
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: inherit !important;
color: inherit;
}
/* Make h1 and h2 the same size as h3. */
h1,
h2 {
font-size: 1.5em;
border-bottom: none !important; /* override GFM */
}
a {
color: $accent-alt;
}
blockquote {
border-left: 2px solid $blockquote-bar-color;
2023-07-21 13:16:33 +01:00
color: $secondary-content;
border-radius: 2px;
padding: 0 10px;
}
/*
// actually, removing the Italic TTF provides
// better results seemingly
// compensate for Nunito italics being terrible
// https://github.com/google/fonts/issues/1726
em {
transform: skewX(-14deg);
display: inline-block;
}
*/
/* Support arbitrarily large marker numbers */
ol {
list-style-position: inside;
padding-inline-start: 0.5em;
}
/* Override nested lists being lower-roman */
ol ol,
ul ol {
list-style-type: revert;
}
/* Make list type disc to match rich text editor */
ul {
list-style-type: disc;
}
2024-08-05 13:58:35 +01:00
/* override styles from the base markdown CSS that put markdown content on its own line,
as this isn't what we want for richtext emote content.
*/
&::before {
display: none;
}
&::after {
display: none;
}
}
2021-07-21 11:41:52 +02:00
}
2021-07-21 08:42:42 +02:00
/* Spoiler stuff */
.mx_EventTile_spoiler {
cursor: pointer;
2024-01-02 18:56:39 +00:00
/* clear button styles */
appearance: none;
background: none;
border: none;
padding: 0;
margin: 0;
font-size: inherit;
font-family: inherit;
line-height: inherit;
2023-10-25 02:48:12 +11:00
text-align: inherit;
.mx_EventTile_spoiler_reason {
color: $event-timestamp-color;
font-size: $font-11px;
}
2021-07-21 08:42:42 +02:00
.mx_EventTile_spoiler_content {
filter: blur(5px) saturate(0.1) sepia(1);
transition-duration: 0.5s;
pointer-events: none;
}
2021-07-21 08:42:42 +02:00
&.visible > .mx_EventTile_spoiler_content {
filter: none;
user-select: auto;
pointer-events: auto;
}
2021-07-21 08:42:42 +02:00
}
.mx_EventTile_bigEmoji {
font-size: 48px;
2022-01-21 05:10:57 -05:00
line-height: 57px;
.mx_Emoji {
font-size: inherit !important;
}
}
.mx_EventTile_e2eIcon {
2021-07-07 15:13:58 +02:00
position: relative;
width: 14px;
height: 14px;
2019-12-03 22:41:22 -07:00
display: block;
2019-02-01 16:43:12 +01:00
svg {
height: inherit;
width: inherit;
display: block;
}
}
.mx_EventTile_body {
a:hover {
text-decoration: underline;
}
pre {
border: 1px solid transparent;
2022-06-27 06:38:17 +00:00
.mx_EventTile:hover &,
2023-09-28 12:52:26 +01:00
.mx_EventTile:focus-visible:focus-within & {
2022-06-27 06:38:17 +00:00
border: 1px solid $tertiary-content;
}
}
/* selector wrongly applies to pill avatars but those have explicit width/height passed at a higher specificity */
&.markdown-body img {
object-fit: contain;
object-position: left top;
/* Override the default colors of the 'github-markdown-css' library
(#fff for light theme, #000 for dark theme) to match the inherited theme */
background-color: inherit !important;
}
2019-07-10 16:55:03 +01:00
2022-06-27 06:38:17 +00:00
.mx_EventTile_clamp & {
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
}
2022-06-27 06:38:17 +00:00
.mx_EventTile_pre_container {
/* For correct positioning of _copyButton (See TextualBody) */
2022-06-27 06:38:17 +00:00
position: relative;
&:focus-within,
&:hover {
.mx_EventTile_button {
visibility: visible;
}
}
.mx_EventTile_collapsedCodeBlock {
max-height: 30vh;
2023-01-19 15:49:21 +00:00
padding-top: $spacing-12;
padding-bottom: $spacing-12;
2022-06-27 06:38:17 +00:00
}
/* Inserted adjacent to <pre> blocks, (See TextualBody) */
2022-06-27 06:38:17 +00:00
.mx_EventTile_button {
position: absolute;
top: $spacing-8;
right: $spacing-8;
width: 16px;
height: 16px;
2022-06-27 06:38:17 +00:00
visibility: hidden;
&.mx_EventTile_buttonBottom {
top: 33px;
}
svg {
width: inherit;
height: inherit;
display: block;
color: $message-action-bar-fg-color;
2022-06-27 06:38:17 +00:00
}
}
}
}
2021-01-21 10:53:18 +01:00
.mx_EventTile_lineNumbers {
float: left;
margin: 0 0.5em 0 -1.5em;
color: gray;
2021-10-18 19:32:20 +01:00
& span {
text-align: right;
display: block;
padding-left: 1em;
}
2021-01-21 10:53:18 +01:00
}
2021-01-20 15:01:23 +01:00
.mx_EventTile_button {
display: inline-block;
cursor: pointer;
2021-01-20 15:01:23 +01:00
}
.mx_EventTile_tileError {
color: red;
2020-03-26 13:47:32 +00:00
text-align: center;
/* Remove some of the default tile padding so that the error is centered */
2020-04-06 11:44:46 +01:00
margin-right: 0;
2021-08-24 09:09:28 +01:00
2020-04-06 11:44:46 +01:00
.mx_EventTile_line {
padding-left: 0;
margin-right: 0;
2022-06-27 06:38:17 +00:00
span {
padding: $spacing-4 $spacing-8;
}
}
a {
margin-left: 1em;
}
2020-02-25 10:20:42 +00:00
}
2021-07-07 12:04:28 +02:00
.mx_EventTile:hover .mx_MessageActionBar,
.mx_EventTile.mx_EventTile_actionBarFocused .mx_MessageActionBar,
[data-whatinput="keyboard"] .mx_EventTile:focus-within .mx_MessageActionBar,
2023-09-28 12:52:26 +01:00
.mx_EventTile:focus-visible:focus-within .mx_MessageActionBar {
2021-07-07 12:04:28 +02:00
visibility: visible;
}
.mx_EventTile[data-shape="ThreadsList"],
.mx_EventTile[data-shape="Notification"] {
--topOffset: $spacing-12;
--leftOffset: 48px;
$borderRadius: 8px;
$padding: $spacing-8;
$hrHeight: 1px;
$notification-dot-size: 8px; /* notification dot next to the timestamp */
margin: calc(var(--topOffset) + $hrHeight) 0 var(--topOffset); /* include the height of horizontal line */
padding: $padding;
border-radius: $borderRadius;
display: flex;
flex-flow: wrap;
align-items: center;
2022-06-07 13:55:11 +00:00
&::after,
&::before {
content: "";
position: absolute;
2022-06-07 13:55:11 +00:00
}
&::after {
$inset-block-start: auto;
$inset-inline-end: calc(-1 * var(--cpd-space-2x));
$inset-block-end: calc(-1 * var(--topOffset) - $hrHeight); /* exclude the height of horizontal line */
2022-06-07 13:55:11 +00:00
$inset-inline-start: calc(var(--leftOffset) + $padding);
inset: $inset-block-start $inset-inline-end $inset-block-end $inset-inline-start;
height: $hrHeight;
background-color: $quinary-content;
pointer-events: none; /* disable the message action bar on hover */
}
&::before {
inset: 0;
pointer-events: none; /* ensures the title for the sender name can be correctly displayed */
}
2022-07-15 14:53:23 +01:00
&[data-notification="total"]::before {
background-color: $room-icon-unread-color;
}
2022-07-15 14:53:23 +01:00
&[data-notification="highlight"]::before {
background-color: $alert;
}
&:last-child {
&::after {
content: unset;
}
margin-bottom: 0;
}
&:first-child {
margin-top: 0;
}
.mx_EventTile_avatar {
2022-06-07 13:55:11 +00:00
inset: $padding auto auto $padding;
}
.mx_EventTile_details {
overflow: hidden;
}
.mx_DisambiguatedProfile {
display: inline-flex;
align-items: center;
flex: 1;
2022-06-07 13:55:11 +00:00
.mx_DisambiguatedProfile_displayName,
.mx_DisambiguatedProfile_mxid {
display: block;
overflow: hidden;
text-overflow: ellipsis;
}
2022-06-07 13:55:11 +00:00
.mx_DisambiguatedProfile_displayName {
flex: none;
max-width: 100%;
}
2022-06-07 13:55:11 +00:00
.mx_DisambiguatedProfile_mxid {
flex: 1;
}
}
.mx_EventTile_line {
width: 100%;
box-sizing: border-box;
padding-bottom: 0;
padding-inline-start: var(--leftOffset);
}
.mx_MessageTimestamp {
font-size: $font-12px;
width: unset; /* Cancel the default width */
overflow: hidden; /* ensure correct overflow behavior */
text-overflow: ellipsis;
position: initial;
margin-left: auto; /* to ensure it's end-aligned even if it's the only element of its parent */
}
&:hover {
2023-07-12 18:46:49 +01:00
background-color: $panels;
}
/* ThreadsList has always group layout */
2022-07-15 14:53:23 +01:00
&[data-layout="group"]:hover {
.mx_EventTile_line {
2023-07-12 18:46:49 +01:00
background-color: inherit;
box-shadow: none; /* don't show the verification left stroke in the thread list */
}
}
2021-08-23 14:44:44 +01:00
}
.mx_EventTile[data-shape="ThreadsList"] {
.mx_ThreadPanel_replies {
margin-top: $spacing-8;
display: flex;
align-items: center;
position: relative;
font: var(--cpd-font-body-sm-regular);
&::before {
@mixin ThreadSummaryIcon;
}
.mx_ThreadPanel_replies_amount {
@mixin ThreadRepliesAmount;
}
.mx_ThreadSummary_content {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
}
}
/* For style rules of ThreadView, see _ThreadPanel.pcss */
2021-08-17 11:10:02 +01:00
.mx_ThreadView {
--ThreadView_group_spacing-start: 56px; /* 56px: 64px - 8px (padding) */
--ThreadView_group_spacing-end: 8px; /* same as padding */
2021-08-17 11:10:02 +01:00
.mx_EventTile {
display: flex;
flex-direction: column;
.mx_EventTile_roomName {
display: none;
}
/* handling for hidden events (e.g reactions) in the thread view */
&.mx_EventTile_info {
.mx_EventTile_avatar {
position: absolute;
2025-12-02 09:57:28 +00:00
/* Align with hidden event content */
top: 50%;
transform: translateY(-50%);
margin-top: -2px;
margin-bottom: 0;
}
&.mx_EventTile_selected .mx_EventTile_line,
.mx_EventTile_line {
$line-height: $font-12px;
padding-inline-start: 0;
line-height: $line-height;
.mx_EventTile_content,
.mx_RedactedBody {
width: auto;
font-size: $line-height;
}
}
2022-07-15 14:53:23 +01:00
&[data-layout="irc"],
&[data-layout="group"] {
padding-top: 0;
.mx_EventTile_avatar {
/* 14px: avatar width, 4px: align with text */
left: calc(var(--MessageTimestamp-width) + 14px - 4px);
z-index: 9; /* position above the hover styling */
}
.mx_MessageTimestamp {
top: 2px; /* Align with avatar */
}
&.mx_EventTile_selected .mx_EventTile_line,
.mx_EventTile_line {
.mx_EventTile_content,
.mx_RedactedBody {
/* 14px: avatar width, 6px: 20px - 14px */
margin-inline-start: calc(14px + 6px);
}
}
}
2022-07-15 14:53:23 +01:00
&[data-layout="bubble"] {
.mx_EventTile_avatar {
inset-inline-start: 0;
}
&.mx_EventTile_selected .mx_EventTile_line,
.mx_EventTile_line {
.mx_EventTile_content,
.mx_RedactedBody {
margin-inline-start: calc(var(--ThreadView_group_spacing-start) + 14px + 6px);
}
}
}
}
2022-07-15 14:53:23 +01:00
&[data-layout="irc"],
&[data-layout="group"] {
padding-block-start: $spacing-16;
.mx_EventTile_line,
.mx_EventTile_footer {
margin-inline-end: var(--ThreadView_group_spacing-end);
}
2022-05-13 18:04:27 +00:00
.mx_EventTile_line {
padding-block: var(--BaseCard_EventTile_line-padding-block);
/* Add padding to align message text with summary text */
/* See: .mx_EventTile[data-layout="group"] .mx_EventTile_line */
padding-inline-start: var(--ThreadView_group_spacing-start);
.mx_EventTile_content {
&.mx_EditMessageComposer {
padding-inline-start: 0; /* align start of first letter with that of the event body */
}
}
2022-05-13 18:04:27 +00:00
}
.mx_EventTile_footer {
/* Align with message text and summary text */
margin-inline-start: var(--ThreadView_group_spacing-start);
}
&.mx_EventTile_continuation {
padding-block-start: 0; /* Cancel padding-block-start */
}
}
2022-04-08 08:11:08 +00:00
2022-07-15 14:53:23 +01:00
&[data-layout="group"] {
width: 100%;
2022-01-12 09:02:30 +00:00
.mx_EventTile_senderDetails {
2022-01-12 09:02:30 +00:00
display: flex;
align-items: center;
gap: $spacing-16; /* gap between the avatar and the sender ID */
padding-inline-start: $spacing-8;
2022-01-12 09:02:30 +00:00
a {
2022-01-12 09:02:30 +00:00
flex: 1;
min-width: unset;
max-width: 100%;
display: flex;
align-items: center;
.mx_DisambiguatedProfile {
margin-left: 8px;
flex: 1;
}
2022-01-12 09:02:30 +00:00
}
}
.mx_MessageTimestamp {
position: absolute; /* for IRC layout */
top: 2px; /* Align with mx_EventTile_content */
}
}
2022-07-15 14:53:23 +01:00
&[data-layout="bubble"] {
margin-inline: var(--BaseCard_EventTile-spacing-inline);
&::before {
inset-inline: calc(-1 * var(--BaseCard_EventTile-spacing-inline));
z-index: auto; /* enable background color on hover */
}
.mx_ReactionsRow {
position: relative; /* display on hover */
}
.mx_EventTile_line.mx_EventTile_mediaLine {
padding-block: 0;
padding-inline-start: 0;
max-width: var(--EventBubbleTile_line-max-width);
}
2022-07-15 14:53:23 +01:00
&[data-self="true"] {
align-items: flex-end;
.mx_EventTile_line.mx_EventTile_mediaLine {
margin: 0 var(--EventTile_bubble_line-margin-inline-end) 0 0; /* align with normal messages */
}
}
}
2021-11-02 13:18:51 +00:00
}
.mx_GenericEventListSummary {
2022-07-15 14:53:23 +01:00
&[data-layout="irc"],
&[data-layout="group"] {
> .mx_EventTile_line {
padding-inline-start: var(--ThreadView_group_spacing-start); /* align summary text with message text */
padding-inline-end: var(--ThreadView_group_spacing-end); /* align summary text with message text */
}
}
}
2021-08-17 11:10:02 +01:00
}
/* Cascading - compact modern layout on the main timeline and the right panel */
.mx_MatrixChat_useCompactLayout {
.mx_EventTile[data-layout="group"] {
--MatrixChat_useCompactLayout_group-padding-top: $spacing-4;
--MatrixChat_useCompactLayout-top-avatar: 2px;
--MatrixChat_useCompactLayout_line-spacing-block: 0px;
padding-top: var(--MatrixChat_useCompactLayout_group-padding-top);
.mx_EventTile_line,
.mx_EventTile_reply {
padding-block: var(--MatrixChat_useCompactLayout_line-spacing-block);
}
.mx_ReplyChain {
margin-bottom: $spacing-4;
}
&.mx_EventTile_info {
padding-top: 0; /* same as the padding for non-compact .mx_EventTile.mx_EventTile_info */
font-size: $font-13px;
.mx_EventTile_e2eIcon,
.mx_EventTile_avatar {
top: 0;
margin-block: var(--MatrixChat_useCompactLayout_line-spacing-block);
}
.mx_EventTile_line,
.mx_EventTile_reply {
line-height: $font-20px;
}
}
&.mx_EventTile_emote {
padding-top: $spacing-8; /* add a bit more space for emotes so that avatars don't collide */
.mx_EventTile_avatar {
top: var(--MatrixChat_useCompactLayout-top-avatar);
}
.mx_EventTile_line,
.mx_EventTile_reply {
padding-bottom: 1px;
}
&.mx_EventTile_continuation {
.mx_EventTile_line,
.mx_EventTile_reply {
padding-bottom: var(--MatrixChat_useCompactLayout_line-spacing-block);
}
}
}
/* Cascading - apply zero padding to every element including mx_EventTile_emote */
&.mx_EventTile_continuation {
padding-top: var(--MatrixChat_useCompactLayout_line-spacing-block);
}
.mx_EventTile_avatar {
top: var(--MatrixChat_useCompactLayout-top-avatar);
}
.mx_EventTile_e2eIcon {
margin: 0px;
}
.mx_DisambiguatedProfile {
font-size: $font-13px;
}
.mx_EventTile_msgOption {
.mx_ReadReceiptGroup {
/* This aligns the avatar with the last line of the */
/* message. We want to move it one line up - 2rem */
inset-block-start: -2rem;
}
}
.mx_EventTile_content .markdown-body {
p,
ul,
ol,
dl,
blockquote,
pre,
table {
margin-bottom: $spacing-4; /* 1/4 of the non-compact margin-bottom */
}
}
}
}
.mx_EventTile_details {
display: flex;
2023-01-16 14:46:54 +01:00
width: stretch;
align-items: center;
justify-content: space-between;
gap: $spacing-8;
margin-left: var(--leftOffset);
.mx_EventTile_truncated {
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
2024-07-31 23:23:46 +01:00
.mx_EventTile_annotated {
display: flex;
}
.mx_EventTile_footer {
display: flex;
gap: var(--cpd-space-2x);
align-items: center;
}
/* Media query for mobile UI */
@media only screen and (max-width: 480px) {
.mx_EventTile_content {
margin-right: 0;
}
}