Tidy up IRCLayout.pcss (#10189)

* Specify the data-layout=irc against ':not([data-layout=bubble])'

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Include mx_EventTile_info in mx_EventTile[data-layout=irc]

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Move declarations up, removing a default declaration

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Tidy up mx_EventTile:hover

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Use a spacing variable

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Sort by order properties

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Move and add comments

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Merge style declarations - flex-shrink and height

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Consider cascading order

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Move order declaration top

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

* Fix an invalid comment

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>

---------

Signed-off-by: Suguru Hirahara <luixxiul@users.noreply.github.com>
This commit is contained in:
Suguru Hirahara 2023-04-23 07:37:20 +00:00 committed by GitHub
parent 92906c2130
commit ba796504f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,57 +17,54 @@ limitations under the License.
$irc-line-height: $font-18px; $irc-line-height: $font-18px;
.mx_IRCLayout { .mx_IRCLayout {
--name-width: 80px; // cf. ircDisplayNameWidth on Settings.tsx --name-width: 80px; /* cf. ircDisplayNameWidth on Settings.tsx */
--icon-width: 14px; --icon-width: 14px;
--right-padding: 5px;
--line-height: $irc-line-height; --line-height: $irc-line-height;
--right-padding: 5px; /* TODO: Use a spacing variable */
line-height: var(--line-height) !important; line-height: var(--line-height) !important;
blockquote {
margin: 0;
}
.mx_NewRoomIntro { .mx_NewRoomIntro {
> h2 { > h2 {
line-height: initial; /* Cancel $irc-line-height */ line-height: initial; /* Cancel $irc-line-height */
} }
} }
.mx_EventTile { .mx_EventTile[data-layout="irc"] {
--EventTile_irc_line-padding-block: 1px; --EventTile_irc_line-padding-block: 1px;
/* timestamps are links which shouldn't be underlined */
> a {
text-decoration: none;
min-width: $MessageTimestamp_width;
}
display: flex; display: flex;
flex-direction: row;
align-items: flex-start; align-items: flex-start;
padding-top: 0; padding-top: 0;
> a {
text-decoration: none; /* timestamps are links which shouldn't be underlined */
min-width: $MessageTimestamp_width; /* ensure space for EventTile without timestamp */
}
> * { > * {
margin-right: var(--right-padding); margin-right: var(--right-padding);
} }
.mx_EventTile_msgOption { .mx_EventTile_avatar,
order: 5; .mx_EventTile_e2eIcon {
flex-shrink: 0; height: $irc-line-height;
} }
.mx_EventTile_line, .mx_EventTile_avatar,
.mx_EventTile_reply { .mx_DisambiguatedProfile,
display: flex; .mx_EventTile_e2eIcon,
flex-direction: column; .mx_EventTile_msgOption {
order: 3; flex-shrink: 0;
flex-grow: 1;
flex-shrink: 1;
min-width: 0;
} }
.mx_EventTile_avatar { .mx_EventTile_avatar {
order: 1; order: 1;
position: relative; position: relative;
flex-shrink: 0;
height: $irc-line-height;
display: flex; display: flex;
align-items: center; align-items: center;
@ -82,10 +79,9 @@ $irc-line-height: $font-18px;
} }
.mx_DisambiguatedProfile { .mx_DisambiguatedProfile {
order: 2;
width: var(--name-width); width: var(--name-width);
margin-inline-end: 0; /* override mx_EventTile > * */ margin-inline-end: 0; /* override mx_EventTile > * */
order: 2;
flex-shrink: 0;
> .mx_DisambiguatedProfile_displayName { > .mx_DisambiguatedProfile_displayName {
width: 100%; width: 100%;
@ -96,9 +92,8 @@ $irc-line-height: $font-18px;
> .mx_DisambiguatedProfile_mxid { > .mx_DisambiguatedProfile_mxid {
visibility: collapse; visibility: collapse;
/* Override the inherited margin. */ margin-left: 0; /* Override the inherited margin. */
margin-left: 0; padding: 0 5px; /* TODO: Use a spacing variable */
padding: 0 5px;
} }
&:hover { &:hover {
@ -110,7 +105,7 @@ $irc-line-height: $font-18px;
display: inline; display: inline;
background-color: $event-selected-color; background-color: $event-selected-color;
border-radius: 8px 0 0 8px; border-radius: 8px 0 0 8px;
padding-right: 8px; padding-right: $spacing-8;
} }
> .mx_DisambiguatedProfile_mxid { > .mx_DisambiguatedProfile_mxid {
@ -123,12 +118,7 @@ $irc-line-height: $font-18px;
.mx_EventTile_e2eIcon { .mx_EventTile_e2eIcon {
padding: 0; padding: 0;
flex-shrink: 0;
flex-grow: 0; flex-grow: 0;
height: $font-18px;
background-position: center; background-position: center;
} }
@ -155,13 +145,34 @@ $irc-line-height: $font-18px;
} }
} }
.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 { .mx_EventTile_reply {
order: 4; order: 4;
} }
.mx_EventTile_msgOption {
order: 5;
}
.mx_EditMessageComposer_buttons { .mx_EditMessageComposer_buttons {
position: relative; position: relative;
} }
&.mx_EventTile_info {
.mx_ViewSourceEvent, /* For hidden events */
.mx_TextualEvent {
line-height: $irc-line-height;
}
}
} }
.mx_EventTile_emote { .mx_EventTile_emote {
@ -171,17 +182,6 @@ $irc-line-height: $font-18px;
} }
} }
blockquote {
margin: 0;
}
.mx_EventTile.mx_EventTile_info {
.mx_ViewSourceEvent, /* For hidden events */
.mx_TextualEvent {
line-height: $irc-line-height;
}
}
.mx_ReplyChain { .mx_ReplyChain {
.mx_DisambiguatedProfile { .mx_DisambiguatedProfile {
width: unset; width: unset;