element-web/res/css/views/settings/_AvatarSetting.scss

134 lines
3.5 KiB
SCSS
Raw Normal View History

/*
Copyright 2019, 2020 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
.mx_AvatarSetting_avatar {
width: 90px;
min-width: 90px; // so it doesn't get crushed by the flexbox in languages with longer words
height: 90px;
margin-top: 8px;
position: relative;
.mx_AvatarSetting_hover {
2020-09-24 17:23:06 +03:00
transition: opacity $hover-transition;
// position to place the hover bg over the entire thing
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
pointer-events: none; // let the pointer fall through the underlying thing
line-height: 90px;
text-align: center;
> span {
color: #fff; // hardcoded to contrast with background
position: relative; // tricks the layout engine into putting this on top of the bg
font-weight: 500;
}
.mx_AvatarSetting_hoverBg {
// absolute position to lazily fill the entire container
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
opacity: 0.5;
background-color: $settings-profile-overlay-placeholder-fg-color;
border-radius: 90px;
}
}
&.mx_AvatarSetting_avatar_hovering .mx_AvatarSetting_hover {
opacity: 1;
}
&:not(.mx_AvatarSetting_avatar_hovering) .mx_AvatarSetting_hover {
opacity: 0;
}
& > * {
box-sizing: border-box;
}
.mx_AccessibleButton.mx_AccessibleButton_kind_primary {
margin-top: 8px;
}
.mx_AccessibleButton.mx_AccessibleButton_kind_link_sm {
width: 100%;
}
& > img {
cursor: pointer;
2019-12-16 19:23:35 +03:00
object-fit: cover;
}
& > img,
.mx_AvatarSetting_avatarPlaceholder {
display: block;
height: 90px;
width: inherit;
border-radius: 90px;
cursor: pointer;
}
.mx_AvatarSetting_avatarPlaceholder::before {
background-color: $settings-profile-overlay-placeholder-fg-color;
mask: url("$(res)/img/feather-customised/user.svg");
mask-repeat: no-repeat;
mask-size: 36px;
mask-position: center;
content: '';
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
.mx_AvatarSetting_uploadButton {
width: 32px;
height: 32px;
border-radius: 32px;
2020-09-23 21:30:01 +03:00
background-color: $settings-profile-button-bg-color;
position: absolute;
bottom: 0;
right: 0;
}
.mx_AvatarSetting_uploadButton::before {
content: "";
display: block;
width: 100%;
height: 100%;
mask-repeat: no-repeat;
mask-position: center;
mask-size: 55%;
Color cleanup number six (#7050) * Remove $voip-decline-color and $voip-accept-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Remove $dialog-background-bg-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $mention-user-pill-bg-color -> $warning-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $plinth-bg-color -> $secondary-accent-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $input-lighter-fg-color -> $input-darker-fg-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $input-valid-border-color -> $accent-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $input-invalid-border-color -> $warning-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $button-bg-color -> $accent-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $avatar-bg-color -> $background Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $preview-widget-fg-color -> $greyed-fg-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $settings-profile-button-fg-color -> $settings-profile-overlay-placeholder-fg-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $presence-online -> $accent-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $pinned-unread-color -> $notice-primary-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $event-highlight-fg-color -> $warning-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $tab-label-active-bg-color -> $accent-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $button-primary-bg-color -> $accent-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $button-danger-bg-color -> $notice-primary-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $button-link-fg-color -> $accent-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $togglesw-on-color -> $accent-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $slider-selection-color -> $accent-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $progressbar-fg-color -> $accent-color Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * $authpage-body-bg-color -> $background Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Fix merge issue Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Fix second merge issue Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
2021-11-08 14:50:53 +03:00
background-color: $settings-profile-overlay-placeholder-fg-color;
mask-image: url('$(res)/img/feather-customised/edit.svg');
}
}
.mx_AvatarSetting_avatar .mx_AvatarSetting_avatarPlaceholder {
background-color: $system;
}