forked from CoreBunch/Instatic
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUserAvatar.module.css
More file actions
42 lines (39 loc) · 1.18 KB
/
Copy pathUserAvatar.module.css
File metadata and controls
42 lines (39 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/* UserAvatar — circular avatar slot with image OR initials fallback.
*
* `--avatar-size` is the only knob the consumer supplies (in px) — every
* other dimension and font size derives from it so the component scales
* cleanly from the 28px toolbar trigger to the 96px Profile tab portrait
* without per-call CSS overrides.
*/
.root {
--avatar-size: 96px;
width: var(--avatar-size);
height: var(--avatar-size);
border-radius: 999px;
border: 1px solid var(--border);
background: var(--bg-surface-2);
color: var(--text-bright);
display: inline-flex;
align-items: center;
justify-content: center;
overflow: hidden;
user-select: none;
position: relative;
flex-shrink: 0;
}
.image {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
/* Pixel-art-style identicons stay crisp at small sizes without bilinear
* smoothing; uploaded photos handle smoothing via the browser default
* and don't notice the hint at avatar scales. */
background: var(--bg-surface-2);
}
.initials {
font-size: calc(var(--avatar-size) * 0.4);
font-weight: 700;
letter-spacing: 0.02em;
text-transform: uppercase;
}