summaryrefslogtreecommitdiffstats
path: root/apps/web-shared/src/styles/components/user-menu.scss
blob: 1b5c1d5f1a2a8debba95849f5e28d8e2a554506e (plain) (blame)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
@use '../base' as *;
@use 'menu.scss' as *;

/* -------------------------------- 

File#: _2_user-menu
Title: User Menu
Descr: A menu controlled by the user profile image
Usage: codyhouse.co/license

-------------------------------- */

.user-menu-control {
  --profile-figure-size: 40px;

  cursor: pointer;
  display: inline-flex;
  align-items: center;
  text-align: left;

  &:hover {
    .user-menu-control__img-wrapper {
      opacity: 0.8;
    }

    .user-menu__meta-title {
      color: var(--color-primary);
    }
  }

  &:focus, &.menu-control--active {
    outline: none;

    .user-menu-control__img-wrapper::after {
      opacity: 1;
      transform: scale(1);
    }
  }
}

.user-menu-control__img-wrapper {
  width: var(--profile-figure-size);
  height: var(--profile-figure-size);
  position: relative;
  transition: opacity 0.2s;

  &::after {
    content: '';
    position: absolute;
    z-index: -1;
    left: -4px;
    top: -4px;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    width: calc(var(--profile-figure-size) + 8px);
    height: calc(var(--profile-figure-size) + 8px);
    border: 2px solid var(--color-primary);
    pointer-events: none;

    opacity: 0;
    transform: scale(0.8);

    transition: all 0.2s;
  }
}

.user-menu-control__img {
  display: block;
  width: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.user-menu__meta {
  max-width: 100px;
}

.user-menu__meta-title {
  transition: color 0.2s;
}