Summary Files Commits Branches @commit @diff @stats
path: root / src / _badges.scss
blob: d67f6d19a2a50f4d9fe2836a93bc3c39564a2a8e (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
// Badges
.badge {
  position: relative;
  white-space: nowrap;

  &[data-badge],
  &:not([data-badge]) {
    &::after {
      background: $primary-color;
      background-clip: padding-box;
      border-radius: .5rem;
      box-shadow: 0 0 0 .1rem $bg-color-light;
      color: $light-color;
      content: attr(data-badge);
      display: inline-block;
      transform: translate(-.05rem, -.5rem);
    }
  }
  &[data-badge] {
    &::after {
      font-size: $font-size-sm;
      height: .9rem;
      line-height: 1;
      min-width: .9rem;
      padding: .1rem .2rem;
      text-align: center;
      white-space: nowrap;
    }
  }
  &:not([data-badge]),
  &[data-badge=""] {
    &::after {
      height: 6px;
      min-width: 6px;
      padding: 0;
      width: 6px;
    }
  }

  // Badges for Buttons
  &.btn {
    &::after {
      position: absolute;
      top: 0;
      right: 0;
      transform: translate(50%, -50%);
    }
  }

  // Badges for Avatars
  &.avatar {
    &::after {
      position: absolute;
      top: 14.64%;
      right: 14.64%;
      transform: translate(50%, -50%);
      z-index: $zindex-1;
    }
  }
}