summaryrefslogtreecommitdiff
path: root/sass/components/_badges.scss
blob: ffed87dc41a754b8a6bd0b17209b80b1c23d3e26 (plain)
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
// Badges
span.badge {
  min-width: 3rem;
  padding: 0 6px;
  margin-left: 14px;
  text-align: center;
  font-size: 1rem;
  line-height: $badge-height;
  height: $badge-height;
  color: color('grey', 'darken-1');
  float: right;
  box-sizing: border-box;

  &.new {
    font-weight: 300;
    font-size: 0.8rem;
    color: #fff;
    background-color: $badge-bg-color;
    border-radius: 2px;
  }
  &.new:after {
    content: " new";
  }

  &[data-badge-caption]::after {
    content: " " attr(data-badge-caption);
  }
}

// Special cases
nav ul a span.badge {
  display: inline-block;
  float: none;
  margin-left: 4px;
  line-height: $badge-height;
  height: $badge-height;
  -webkit-font-smoothing: auto;
}

// Line height centering
.collection-item span.badge {
  margin-top: calc(#{$collection-line-height / 2} - #{$badge-height / 2});
}
.collapsible span.badge {
  margin-left: auto;
}
.sidenav span.badge {
  margin-top: calc(#{$sidenav-line-height / 2} - #{$badge-height / 2});
}

table span.badge {
  display: inline-block;
  float: none;
  margin-left: auto;
}