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

Commit 3a20cb1

Browse files
authored
Improve style rules of threads list (#8706)
* Remove obsolete declarations - border-radius of EventTile_line The border-radius is specified with .mx_EventTile[data-shape="ThreadsList"] Signed-off-by: Suguru Hirahara <[email protected]> * Move declarations for ThreadSummary on Threadslist from _ThreadsPanel.scss to _EventTile.scss To .mx_EventTile[data-shape=ThreadsList] Signed-off-by: Suguru Hirahara <[email protected]> * mx_ThreadPanel_replies block is used only on threads list after all Signed-off-by: Suguru Hirahara <[email protected]> * &::after and &::before Signed-off-by: Suguru Hirahara <[email protected]> * Set shorthand property and use variables - Shorthand for inset property of border between threads - Use variables Signed-off-by: Suguru Hirahara <[email protected]> * Change 'ThreadPanel_ThreadsAmount' class name to 'ThreadPanel_replies_amount' Signed-off-by: Suguru Hirahara <[email protected]> * specific to prevent regressions Signed-off-by: Suguru Hirahara <[email protected]>
1 parent 5da187d commit 3a20cb1

File tree

3 files changed

+43
-39
lines changed

3 files changed

+43
-39
lines changed

res/css/views/right_panel/_ThreadPanel.scss

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -284,18 +284,6 @@ limitations under the License.
284284
}
285285
}
286286

287-
.mx_ThreadPanel_replies {
288-
margin-top: $spacing-8;
289-
display: flex;
290-
align-items: center;
291-
position: relative;
292-
293-
.mx_ThreadPanel_ThreadsAmount {
294-
@mixin ThreadsAmount;
295-
font-size: $font-12px; // Same font size as the counter on the main panel
296-
}
297-
}
298-
299287
.mx_ThreadPanel_viewInRoom::before {
300288
mask-image: url('$(res)/img/element-icons/view-in-room.svg');
301289
}

res/css/views/rooms/_EventTile.scss

Lines changed: 42 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,7 @@ $threadInfoLineHeight: calc(2 * $font-12px); // See: _commons.scss
728728
$borderRadius: 8px;
729729
$padding: $spacing-8;
730730
$hrHeight: 1px;
731+
$notification-dot-size: 8px; // notification dot next to the timestamp
731732

732733
margin: calc(var(--topOffset) + $hrHeight) 0 var(--topOffset); // include the height of horizontal line
733734
padding: $padding $spacing-24 $padding $padding;
@@ -747,29 +748,34 @@ $threadInfoLineHeight: calc(2 * $font-12px); // See: _commons.scss
747748
box-shadow: none; // don't show the verification left stroke in the thread list
748749
}
749750

750-
&::after {
751+
&::after,
752+
&::before {
751753
content: "";
752754
position: absolute;
753-
left: calc(var(--leftOffset) + $padding);
754-
right: $spacing-24; // 24px: 32px - 8px (right padding)
755+
}
756+
757+
&::after {
758+
$inset-block-start: auto;
759+
$inset-inline-end: calc(32px - $padding);
760+
$inset-block-end: calc(-1 * var(--topOffset) - $hrHeight); // exclude the height of horizontal line
761+
$inset-inline-start: calc(var(--leftOffset) + $padding);
762+
inset: $inset-block-start $inset-inline-end $inset-block-end $inset-inline-start;
763+
755764
height: $hrHeight;
756-
bottom: calc(-1 * var(--topOffset) - $hrHeight); // exclude the height of horizontal line
757765
background-color: $quinary-content;
758766
pointer-events: none; // disable the message action bar on hover
759767
}
760768

761769
&::before {
762-
content: "";
763-
position: absolute;
764770
inset: 0;
765771
}
766772

767773
// Display notification dot
768774
&[data-notification]::before {
769-
width: 8px;
770-
height: 8px;
775+
width: $notification-dot-size;
776+
height: $notification-dot-size;
771777
border-radius: 50%;
772-
inset: 14px 8px auto auto; // 14px: align the dot with the timestamp row
778+
inset: 14px $spacing-8 auto auto; // 14px: align the dot with the timestamp row
773779
}
774780

775781
&[data-notification=total]::before {
@@ -793,36 +799,46 @@ $threadInfoLineHeight: calc(2 * $font-12px); // See: _commons.scss
793799
}
794800

795801
.mx_EventTile_avatar {
796-
top: $padding;
797-
left: $padding;
802+
inset: $padding auto auto $padding;
798803
}
799804

800805
.mx_DisambiguatedProfile {
801-
margin-right: 12px;
806+
margin-right: $spacing-12;
802807
display: inline-flex;
803808
flex: 1;
804-
}
805809

806-
.mx_DisambiguatedProfile_displayName,
807-
.mx_DisambiguatedProfile_mxid {
808-
display: block;
809-
overflow: hidden;
810-
text-overflow: ellipsis;
811-
}
810+
.mx_DisambiguatedProfile_displayName,
811+
.mx_DisambiguatedProfile_mxid {
812+
display: block;
813+
overflow: hidden;
814+
text-overflow: ellipsis;
815+
}
812816

813-
.mx_DisambiguatedProfile_displayName {
814-
flex: none;
815-
max-width: 100%;
816-
}
817+
.mx_DisambiguatedProfile_displayName {
818+
flex: none;
819+
max-width: 100%;
820+
}
817821

818-
.mx_DisambiguatedProfile_mxid {
819-
flex: 1;
822+
.mx_DisambiguatedProfile_mxid {
823+
flex: 1;
824+
}
820825
}
821826

822827
.mx_EventTile_line {
823828
width: 100%;
824829
box-sizing: border-box;
825-
border-radius: $borderRadius !important; // override 4px
830+
831+
.mx_ThreadPanel_replies {
832+
margin-top: $spacing-8;
833+
display: flex;
834+
align-items: center;
835+
position: relative;
836+
837+
.mx_ThreadPanel_replies_amount {
838+
@mixin ThreadsAmount;
839+
font-size: $font-12px; // Same font size as the counter on the main panel
840+
}
841+
}
826842
}
827843

828844
.mx_DisambiguatedProfile,

src/components/views/rooms/EventTile.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ export class UnwrappedEventTile extends React.Component<IProps, IState> {
518518
}
519519

520520
return <div className="mx_ThreadPanel_replies">
521-
<span className="mx_ThreadPanel_ThreadsAmount">
521+
<span className="mx_ThreadPanel_replies_amount">
522522
{ this.state.thread.length }
523523
</span>
524524
<ThreadMessagePreview thread={this.state.thread} />

0 commit comments

Comments
 (0)