Skip to content

Commit

Permalink
Align displayName to the right side when mxId is rendered
Browse files Browse the repository at this point in the history
Since displayName on ReplyChain is aligned to the left side on our UI as well, the default way of displaying and hiding mxId with visibility declaration is set to be applied.

This commit also fixes the variable for line height, removing `unset` as it is no longer necessary.
  • Loading branch information
luixxiul committed Mar 3, 2024
1 parent ca905b9 commit 7778c19
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions res/css/_sc/views/rooms/_IRCLayout.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,31 @@ limitations under the License.
}
}

@define-mixin sc_DisambiguatedProfile_visibility {
.mx_DisambiguatedProfile {
> .mx_DisambiguatedProfile_mxid {
display: none;
}

&:hover {
> .mx_DisambiguatedProfile_mxid {
display: unset;
}
}
}

.mx_ReplyChain_wrapper .mx_ReplyChain .mx_DisambiguatedProfile {
/* Stop mxid from moving avatar up on ReplyChain by resetting display
value "none" defined above, in order to make visibility declaration
effective */
/* Mind difference of avatar placement between on upstream's
mx_EventTile and mx_ReplyTile_sender */
> .mx_DisambiguatedProfile_mxid {
display: unset;
}
}
}

@define-mixin sc_DisambiguatedProfile {
.mx_DisambiguatedProfile {
/* Align elements to the end side */
Expand All @@ -50,6 +75,8 @@ limitations under the License.
padding-inline-start: 0; /* Remove the value specified on upstream since var(--right-padding) is specified for mx_DisambiguatedProfile_displayName above */
}
}

@mixin sc_DisambiguatedProfile_visibility;
}

@define-mixin sc_BaseAvatar {
Expand Down Expand Up @@ -84,9 +111,7 @@ limitations under the License.
}

.mx_DisambiguatedProfile {
--cpd-font-body-md-regular: var(--line-height); /* Fix the line-height value specified with Compound for IRC layout */

display: unset; /* Unset the inherited value */
--cpd-font-line-height-regular: var(--line-height); /* Fix the line-height value specified with Compound for IRC layout */
}
}
}
Expand Down

0 comments on commit 7778c19

Please sign in to comment.