Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

user_circles: Better fit and position circles over avatars.

Karl Stolley7cdcf72c9a8d
diff --git a/web/styles/right_sidebar.css b/web/styles/right_sidebar.css
index 0a2db8096b2..9dc88d091fa 100644
--- a/web/styles/right_sidebar.css
+++ b/web/styles/right_sidebar.css
@@ -164,17 +164,34 @@
}
.user_sidebar_entry.with_avatar {
- .user-profile-picture {
+ .user-profile-picture-container {
/* Establish positioning context for user circle. */
position: relative;
+ /* TODO: Express this as part of the grid on
+ .selectable_sidebar_block. */
+ margin-right: 11px;
+
+ &:not(:has(.user-circle-offline)) .user-profile-picture {
+ /* The over-avatar user circle width is 15.5px at 20px/1em;
+ we adjust the border radius here to avoid any pixels
+ from the avatar bleeding through. */
+ border-bottom-right-radius: 0.3875em; /* 7.75px at 20px/1em */
+ }
+ }
+
+ .user-profile-picture {
+ /* Push back on the margin-right usually allotted here;
+ we put it on .user-profile-picture-container instead,
+ so that user circles occupy the corner of the image. */
+ margin-right: 0;
}
.user-circle {
position: absolute;
/* 10px at 16px/1em */
font-size: 0.625em;
- bottom: -1px;
- right: -1px;
+ bottom: -0.5px;
+ right: -0.5px;
background-color: var(--color-background);
/* A 1.5px border provides better results than
a 1px border, especially at smaller font sizes. */
diff --git a/web/templates/presence_row.hbs b/web/templates/presence_row.hbs
index 076678b5f8d..6f040cfc793 100644
--- a/web/templates/presence_row.hbs
+++ b/web/templates/presence_row.hbs
@@ -16,13 +16,15 @@
</div>
</a>
{{else if user_list_style.WITH_AVATAR}}
- <div class="user-profile-picture avatar-preload-background">
- <img loading="lazy" src="{{profile_picture}}"/>
- {{#if (eq user_circle_class "user-circle-deactivated")}}
- <span class="fa fa-ban {{user_circle_class}} user-circle"></span>
- {{else}}
- <span class="zulip-icon zulip-icon-{{user_circle_class}} {{user_circle_class}} user-circle"></span>
- {{/if}}
+ <div class="user-profile-picture-container">
+ <div class="user-profile-picture avatar-preload-background">
+ <img loading="lazy" src="{{profile_picture}}"/>
+ {{#if (eq user_circle_class "user-circle-deactivated")}}
+ <span class="fa fa-ban {{user_circle_class}} user-circle"></span>
+ {{else}}
+ <span class="zulip-icon zulip-icon-{{user_circle_class}} {{user_circle_class}} user-circle"></span>
+ {{/if}}
+ </div>
</div>
<a class="user-presence-link" href="{{href}}">
<div class="user-name-and-status-wrapper">