Files
wekan/client/components/users/userAvatar.css
T
Lauri Ojansivu c56c03d202 Minicard avatars in the order people were added, each with its own colour.
The minicard floated every avatar to the end of its row, which drew them
in reverse: the person added first, whom a team treats as the responsible
one, came last, while the opened card showed them first. The avatars are a
wrapping row aligned to the end now, in the order they were added - still
wrapping right-aligned as #5081 asked. Each person's initials avatar has a
colour of their own, the same everywhere and every time
(models/lib/avatarColor.js), every colour keeping the initials readable at
WCAG AA, and the avatar's tooltip names the person.

Thanks to HolgerGH and xet7 !

Fixes #2110.
2026-10-14 13:40:15 +03:00

225 lines
5.4 KiB
CSS

.member {
border-radius: 3px;
display: block;
position: relative;
float: inline-start;
height: 24px;
width: 24px;
margin: 3px;
cursor: pointer;
user-select: none;
z-index: 1;
text-decoration: none;
border-radius: 50%;
}
.member .avatar {
overflow: hidden;
border-radius: 50%;
}
.member .avatar.avatar-initials {
/* The grey is only a fallback: each person has a colour of their own (#2110,
set inline from models/lib/avatarColor.js). The initials take its text colour. */
height: 70%;
width: 70%;
padding: 15%;
background-color: #dbdbdb;
color: #444;
position: absolute;
display: flex;
align-items: center;
justify-content: center;
}
/* SVG text is drawn with `fill`, not `color`: the initials follow the
person's text colour (#2110). */
.member .avatar.avatar-initials text {
fill: currentColor;
}
.member .avatar.avatar-image {
object-fit: cover;
object-position: center;
height: 100%;
width: 100%;
}
.member .member-presence-status {
background-color: #b3b3b3;
border: 1px solid #fff;
border-radius: 50%;
height: 7px;
width: 7px;
position: absolute;
inset-inline-end: -1px;
bottom: -1px;
border: 1px solid #fff;
z-index: 15;
}
.member .member-presence-status.active {
background: #64c464;
border-color: #daf1da;
}
.member .member-presence-status.idle {
background: #e4e467;
border-color: #f7f7d4;
}
.member .member-presence-status.disconnected {
background: #bdbdbd;
border-color: #ededed;
}
.member .member-presence-status.pending {
background: #e44242;
border-color: #f1dada;
}
.member .edit-avatar {
position: absolute;
top: 0;
height: 100%;
width: 100%;
border-radius: 50%;
background: #000;
display: flex;
align-items: center;
justify-content: center;
opacity: 0;
}
.member .edit-avatar:hover {
opacity: 0.6;
}
.member .edit-avatar i.fa-pencil {
color: #fff;
}
.member.add-member {
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 0 0 2px #bfbfbf inset;
}
.member.add-member:hover,
.member.add-member.is-active {
box-shadow: 0 0 0 2px #666 inset;
}
/* Change profile image popup (changeAvatarPopup / adminChangeAvatarPopup).
One row per avatar: thumbnail, file name, a check when it is the one in use,
and a delete button. The delete button is a SIBLING of the select link (see
userAvatar.jade), so it needs its own row-level flex layout here. */
.avatar-list .avatar-list-item {
display: flex;
align-items: stretch;
}
.avatar-list .avatar-list-select {
flex: 1 1 auto;
min-width: 0;
display: flex;
align-items: center;
gap: 8px;
}
.avatar-list .avatar-list-select > .member {
align-self: center;
margin: 0;
}
.avatar-list .avatar-list-info {
flex: 1 1 auto;
min-width: 0;
line-height: calc(18px * var(--wekan-ui-font-scale, 1));
padding: 4px 0;
}
.avatar-list .avatar-list-name {
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.avatar-list .avatar-list-check {
flex: 0 0 auto;
color: #3cb500;
}
/* Marks the avatar in use; :not(:hover) so the popup's own hover colour still wins. */
.avatar-list .avatar-list-item.selected .avatar-list-select:not(:hover) {
background-color: #e2e6e9;
}
.avatar-list .avatar-list-delete {
flex: 0 0 auto;
display: flex;
align-items: center;
padding: 0 12px;
color: #8c8c8c !important;
}
/* Outweighs .pop-over-list li > a:not(.disabled):hover, which would otherwise
paint the delete button with the generic blue row-hover colour. */
.avatar-list.pop-over-list li > a.avatar-list-delete:hover {
color: #fff !important;
background-color: #b04632;
}
.avatar-upload-hints {
color: #8c8c8c;
font-size: calc(12px * var(--wekan-ui-font-scale, 1));
line-height: calc(16px * var(--wekan-ui-font-scale, 1));
margin: 6px 0;
}
.atMention {
background: #dbdbdb;
border-radius: 3px;
padding: 1px 4px;
margin: -1px 0;
display: inline-block;
}
.atMention.me {
background: #cfdfe8;
}
.mini-profile-info {
margin-top: 10px;
}
.mini-profile-info .info {
padding-top: 5px;
}
.mini-profile-info .info h3,
.mini-profile-info .info p {
margin-bottom: 0;
padding-inline-start: 0;
}
.mini-profile-info .info p {
padding-top: 0;
}
.mini-profile-info .member {
width: 40px;
height: 40px;
margin-inline-end: 10px;
}
/* Account-status distinction on the avatar itself (see userAvatar.js
memberAccountClass / isImportedMember / isInactiveMember):
- imported-member: an un-reconciled board-import placeholder that is not yet mapped
to a real account — dashed ring + amber "?" corner badge.
- inactive-member: deactivated on this board (e.g. a person not in LDAP after
reconciliation) — greyscale + dimmed, grey corner badge.
A placeholder is usually both; a real, active account gets neither. */
.member.imported-member .avatar {
border: 2px dashed #7f8c9a;
box-sizing: border-box;
opacity: 0.9;
}
.member.inactive-member .avatar {
filter: grayscale(1);
opacity: 0.55;
}
.member .member-account-badge {
position: absolute;
bottom: -2px;
inset-inline-end: -2px;
min-width: 14px;
height: 14px;
line-height: calc(13px * var(--wekan-ui-font-scale, 1));
padding: 0 1px;
border-radius: 7px;
font-size: calc(10px * var(--wekan-ui-font-scale, 1));
font-weight: bold;
text-align: center;
color: #fff;
box-shadow: 0 0 0 1.5px #fff;
pointer-events: none;
}
.member .member-account-badge.imported {
background: #f39c12;
}
.member .member-account-badge.inactive {
background: #95a5a6;
}