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

Commit 56258bc

Browse files
authored
Improve _GenericEventListSummary.scss (#9005)
* Include mx_BaseAvatar Signed-off-by: Suguru Hirahara <[email protected]> * Include style blocks of mx_MatrixChat_useCompactLayout Signed-off-by: Suguru Hirahara <[email protected]> * yarn run lint:style --fix Signed-off-by: Suguru Hirahara <[email protected]> * Set top padding to avatars on group layout only Signed-off-by: Suguru Hirahara <[email protected]> * Remove a redundant declaration for bubble layout Signed-off-by: Suguru Hirahara <[email protected]> * Set the same margin value to mx_GenericEventListSummary_avatars on every layout Signed-off-by: Suguru Hirahara <[email protected]> * Remove margin-top from mx_GenericEventListSummary_toggle on IRC layout Signed-off-by: Suguru Hirahara <[email protected]> * Remove block margin from mx_GenericEventListSummary_toggle on both IRC layout and modern layout Signed-off-by: Suguru Hirahara <[email protected]> * Set spacing to mx_GenericEventListSummary instead of its child elements Signed-off-by: Suguru Hirahara <[email protected]> * Apply the margin to every layout Signed-off-by: Suguru Hirahara <[email protected]> * Move general rules up Signed-off-by: Suguru Hirahara <[email protected]> * Apply block margin to mx_GenericEventListSummary_toggle of every layout Signed-off-by: Suguru Hirahara <[email protected]> * Apply top margin to modern layout Signed-off-by: Suguru Hirahara <[email protected]> * Include mx_MatrixChat_useCompactLayout Signed-off-by: Suguru Hirahara <[email protected]> * Set top margin to mx_GenericEventListSummary insted of toggle Signed-off-by: Suguru Hirahara <[email protected]> * Use a spacing variable Signed-off-by: Suguru Hirahara <[email protected]> * Remove a redundant declaration Signed-off-by: Suguru Hirahara <[email protected]> * Add a comment Signed-off-by: Suguru Hirahara <[email protected]> * Apply display flex as a default value Signed-off-by: Suguru Hirahara <[email protected]>
1 parent b1fb609 commit 56258bc

File tree

1 file changed

+38
-51
lines changed

1 file changed

+38
-51
lines changed

res/css/views/elements/_GenericEventListSummary.scss

Lines changed: 38 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,45 @@ limitations under the License.
1717
.mx_GenericEventListSummary {
1818
position: relative;
1919

20+
.mx_GenericEventListSummary_avatars {
21+
margin-right: $spacing-8;
22+
}
23+
2024
&[data-layout=irc],
2125
&[data-layout=group] {
2226
.mx_GenericEventListSummary_toggle {
2327
float: right;
24-
margin: 8px 10px 0 0;
25-
}
26-
27-
.mx_GenericEventListSummary_avatars {
28-
padding-top: $spacing-8;
28+
margin-inline: 0 10px;
2929
}
3030
}
3131

32-
&[data-layout=irc] {
33-
.mx_GenericEventListSummary_avatars {
34-
padding: 0;
35-
margin: 0 9px 0 0;
36-
}
32+
&[data-layout=group] {
33+
margin-top: $spacing-8;
3734
}
3835

3936
&[data-layout=bubble] {
4037
--maxWidth: 70%;
38+
display: flex;
4139
margin-left: calc(var(--avatarSize) + var(--gutterSize));
4240

41+
.mx_GenericEventListSummary_toggle {
42+
margin-block: 0;
43+
44+
&[aria-expanded=false] {
45+
order: 9; // TODO: Remove
46+
}
47+
48+
&[aria-expanded=true] {
49+
margin-inline-start: auto; // reduce clickable area
50+
margin-inline-end: var(--EventTile_bubble-margin-inline-end); // as the parent has zero margin
51+
}
52+
}
53+
54+
.mx_GenericEventListSummary_line {
55+
display: none;
56+
}
57+
4358
&[data-expanded=false] {
44-
display: flex;
4559
align-items: center;
4660
justify-content: space-between;
4761
column-gap: 5px;
@@ -50,7 +64,6 @@ limitations under the License.
5064
// ideally we'd use display=contents here for the layout to all work regardless of the *ELS but
5165
// that breaks ScrollPanel's reliance upon offsetTop so we have to have a bit more finesse.
5266
&[data-expanded=true] {
53-
display: flex;
5467
flex-direction: column;
5568
margin: 0;
5669
}
@@ -65,26 +78,22 @@ limitations under the License.
6578
background: transparent;
6679
}
6780
}
81+
}
6882

69-
.mx_GenericEventListSummary_toggle {
70-
margin-block: 0;
71-
72-
&[aria-expanded=false] {
73-
order: 9;
74-
}
83+
.mx_MatrixChat_useCompactLayout & {
84+
font-size: $font-13px;
85+
margin-top: $spacing-4;
7586

76-
&[aria-expanded=true] {
77-
margin-inline-start: auto; // reduce clickable area
78-
margin-inline-end: var(--EventTile_bubble-margin-inline-end); // as the parent has zero margin
79-
}
87+
.mx_EventTile_line {
88+
line-height: $font-20px;
8089
}
8190

8291
.mx_GenericEventListSummary_line {
83-
display: none;
92+
line-height: $font-22px;
8493
}
8594

86-
.mx_GenericEventListSummary_avatars {
87-
padding-top: 0;
95+
.mx_TextualEvent.mx_GenericEventListSummary_summary {
96+
font-size: $font-13px;
8897
}
8998
}
9099
}
@@ -101,38 +110,16 @@ limitations under the License.
101110

102111
.mx_GenericEventListSummary_avatars {
103112
display: inline-block;
104-
margin-right: 8px;
105113
line-height: $font-12px;
106-
}
107114

108-
.mx_GenericEventListSummary_avatars .mx_BaseAvatar {
109-
margin-right: -4px;
110-
cursor: pointer;
115+
.mx_BaseAvatar {
116+
margin-right: -4px;
117+
cursor: pointer;
118+
}
111119
}
112120

113121
.mx_GenericEventListSummary_line {
114122
border-bottom: 1px solid $primary-hairline-color;
115123
margin-left: 63px;
116124
line-height: $font-30px;
117125
}
118-
119-
.mx_MatrixChat_useCompactLayout {
120-
.mx_GenericEventListSummary {
121-
font-size: $font-13px;
122-
.mx_EventTile_line {
123-
line-height: $font-20px;
124-
}
125-
}
126-
127-
.mx_GenericEventListSummary_line {
128-
line-height: $font-22px;
129-
}
130-
131-
.mx_GenericEventListSummary_toggle {
132-
margin-top: 3px;
133-
}
134-
135-
.mx_TextualEvent.mx_GenericEventListSummary_summary {
136-
font-size: $font-13px;
137-
}
138-
}

0 commit comments

Comments
 (0)