debian-mirror-gitlab/app/assets/stylesheets/components/avatar.scss

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

192 lines
3.3 KiB
SCSS
Raw Normal View History

2019-09-04 21:01:54 +05:30
$avatar-sizes: (
16: (
font-size: 10px,
line-height: 16px,
border-radius: $border-radius-small
),
18: (
border-radius: $border-radius-small
),
20: (
border-radius: $border-radius-small
),
24: (
font-size: 12px,
line-height: 24px,
border-radius: $border-radius-default
),
26: (
font-size: 20px,
line-height: 1.33,
border-radius: $border-radius-default
),
32: (
font-size: 14px,
line-height: 32px,
border-radius: $border-radius-default
),
40: (
font-size: 16px,
line-height: 38px,
border-radius: $border-radius-default
),
48: (
font-size: 20px,
line-height: 48px,
border-radius: $border-radius-large
),
60: (
font-size: 32px,
2022-08-27 11:52:29 +05:30
line-height: 60px,
2019-09-04 21:01:54 +05:30
border-radius: $border-radius-large
),
64: (
font-size: 28px,
line-height: 64px,
border-radius: $border-radius-large
),
90: (
font-size: 36px,
2022-08-27 11:52:29 +05:30
line-height: 90px,
2019-09-04 21:01:54 +05:30
border-radius: $border-radius-large
),
2019-09-30 21:07:59 +05:30
96: (
font-size: 36px,
line-height: 94px,
border-radius: $border-radius-large
),
2019-09-04 21:01:54 +05:30
100: (
font-size: 36px,
line-height: 98px,
border-radius: $border-radius-large
),
160: (
font-size: 96px,
line-height: 158px,
border-radius: $border-radius-large
)
);
2021-04-17 20:07:23 +05:30
.avatar,
.avatar-container {
2019-09-04 21:01:54 +05:30
float: left;
margin-right: $gl-padding;
border-radius: $avatar-radius;
@each $size, $size-config in $avatar-sizes {
&.s#{$size} {
@include avatar-size(#{$size}px, if($size < 48, 8px, 16px));
}
}
}
.avatar {
transition-property: none;
width: 40px;
height: 40px;
padding: 0;
background: $gray-lightest;
overflow: hidden;
2022-08-27 11:52:29 +05:30
box-shadow: inset 0 0 0 1px rgba($gray-950, $gl-avatar-border-opacity);
2019-09-04 21:01:54 +05:30
&.avatar-inline {
float: none;
display: inline-block;
margin-left: 2px;
flex-shrink: 0;
2020-06-23 00:09:42 +05:30
&.s16,
2019-09-04 21:01:54 +05:30
&.s24 {
margin-right: 4px;
}
}
&.center {
font-size: 14px;
line-height: 1.8em;
text-align: center;
}
&.avatar-tile {
border-radius: 0;
border: 0;
}
}
.identicon {
text-align: center;
vertical-align: top;
2021-09-30 23:02:18 +05:30
color: $gray-900;
background-color: $gray-50;
2019-09-04 21:01:54 +05:30
// Sizes
@each $size, $size-config in $avatar-sizes {
$keys: map-keys($size-config);
&.s#{$size} {
@each $key in $keys {
// We don't want `border-radius` to be included here.
@if ($key != 'border-radius') {
#{$key}: map-get($size-config, #{$key});
}
}
}
}
// Background colors
2021-09-30 23:02:18 +05:30
@for $i from 1 through length($gl-avatar-identicon-bgs) {
2019-09-04 21:01:54 +05:30
&.bg#{$i} {
2021-09-30 23:02:18 +05:30
background-color: nth($gl-avatar-identicon-bgs, $i);
2019-09-04 21:01:54 +05:30
}
}
}
.avatar-container {
overflow: hidden;
display: flex;
a {
width: 100%;
height: 100%;
display: flex;
text-decoration: none;
}
.avatar {
border-radius: 0;
border: 0;
height: auto;
width: 100%;
margin: 0;
align-self: center;
}
&.s40 {
min-width: 40px;
min-height: 40px;
}
&.s64 {
min-width: 64px;
min-height: 64px;
}
}
.rect-avatar {
border-radius: $border-radius-small;
@each $size, $size-config in $avatar-sizes {
&.s#{$size} {
border-radius: map-get($size-config, 'border-radius');
2022-08-27 11:52:29 +05:30
.avatar {
border-radius: map-get($size-config, 'border-radius');
}
2019-09-04 21:01:54 +05:30
}
}
}
.avatar-counter {
@include avatar-counter();
}