signal-desktop/stylesheets/components/Avatar.scss
2021-08-06 17:35:25 -04:00

119 lines
2.2 KiB
SCSS

// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
.module-Avatar {
align-items: center;
border-radius: 100%;
display: inline-flex;
justify-content: center;
line-height: 0;
overflow: hidden;
position: relative;
user-select: none;
vertical-align: middle;
&__button {
@include button-reset;
align-items: center;
display: flex;
height: 100%;
justify-content: center;
width: 100%;
@include keyboard-mode {
&:focus {
box-shadow: 0px 0px 0px 2px $color-ultramarine;
}
}
}
&__image {
background-position: center center;
background-size: cover;
display: flex;
height: 100%;
transition: filter 100ms ease-out;
width: 100%;
}
&__click-to-view {
@include font-body-2;
align-items: center;
background: $color-black-alpha-20;
color: $color-white;
display: flex;
flex-direction: column;
height: 100%;
justify-content: center;
left: 0;
position: absolute;
top: 0;
width: 100%;
&::before {
@include color-svg(
'../images/icons/v2/click-outline-24.svg',
$color-white
);
content: '';
display: block;
height: 24px;
margin-bottom: 8px;
width: 24px;
}
&:hover {
background: $color-black-alpha-40;
}
}
&__label {
align-items: center;
display: flex;
justify-content: center;
text-align: center;
text-transform: uppercase;
transition: font-size 100ms ease-out;
}
&__icon {
@mixin avatar-icon($icon) {
-webkit-mask: url($icon) no-repeat center;
-webkit-mask-size: 100%;
}
&--direct {
@include avatar-icon('../images/icons/v2/profile-outline-20.svg');
height: 60%;
width: 60%;
}
&--group {
@include avatar-icon('../images/icons/v2/group-outline-24.svg');
height: 62%;
width: 62%;
}
&--note-to-self {
@include avatar-icon('../images/icons/v2/note-24.svg');
height: 62%;
width: 62%;
}
}
&__spinner-container {
padding: 4px;
}
@include avatar-colors();
&--undefined {
background-color: $color-gray-15;
color: $color-gray-75;
&--icon {
background-color: $color-gray-75;
}
}
}