/* =========================
Avatar
Figma: Avatar.
========================= */
@use "../kit-deps" as *;
.avatar {
position: relative;
display: inline-flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
width: 48px;
height: 48px;
border-radius: $radius-full;
background-color: $mint-100;
color: $mint-700;
font-family: $font-family-base;
font-size: 16px;
font-weight: $font-weight-bold;
line-height: 1;
text-transform: uppercase;
overflow: hidden;
user-select: none;
img {
width: 100%;
height: 100%;
object-fit: cover;
}
.avatar-status {
position: absolute;
top: 0;
right: 0;
width: 12px;
height: 12px;
border-radius: 50%;
border: 2px solid $neutral-0;
background-color: $mint-600;
transform: translate(15%, -15%);
&.is-offline { background-color: $neutral-400; }
&.is-busy { background-color: $warning-text; }
&.is-away { background-color: $yellow-500; }
&.is-danger { background-color: $danger-text; }
}
// Sizes
&.avatar-sm {
width: 32px;
height: 32px;
font-size: 12px;
.avatar-status {
width: 8px;
height: 8px;
border-width: 1px;
}
}
&.avatar-md {
width: 48px;
height: 48px;
font-size: 16px;
}
&.avatar-lg {
width: 64px;
height: 64px;
font-size: 20px;
}
&.avatar-xl {
width: 96px;
height: 96px;
font-size: 32px;
}
&.avatar-xs {
width: 24px;
height: 24px;
font-size: 10px;
}
// Variants
&.avatar-neutral {
background-color: $neutral-100;
color: $neutral-700;
}
&.avatar-mint {
background-color: $mint-100;
color: $mint-700;
}
&.avatar-yellow {
background-color: $yellow-100;
color: $yellow-800;
}
&.avatar-lavender {
background-color: $lavender-100;
color: $lavender-700;
}
}
.avatar-stack {
display: inline-flex;
align-items: center;
.avatar {
margin-right: -$space-2;
box-shadow: 0 0 0 2px $neutral-0;
transition: transform $motion-base $motion-ease;
&:hover {
transform: translateY(-2px);
z-index: 1;
}
}
.avatar-stack-count {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 32px;
height: 32px;
padding: 0 $space-2;
margin-left: $space-1;
border-radius: $radius-full;
background-color: $neutral-100;
color: $neutral-700;
font-size: 12px;
font-weight: $font-weight-medium;
box-shadow: 0 0 0 2px $neutral-0;
}
}