summaryrefslogtreecommitdiffstats
path: root/asset/css/balls.less
blob: f3afae3642212f742119901601ee6159da8a157d (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
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
@ball-pad: 1/6em;

.ball {
  border-radius: 50%;
  display: inline-block;
  text-align: center;
}

.ball-size-xs {
  height: 1/3em;
  width: 1/3em;
}

.ball-size-s {
  height: 0.5em;
  width: 0.5em;
}

.ball-size-m {
  height: 0.75em;
  width: 0.75em;
  line-height: 0;

  i.icon:before {
    font-size: .75 - @ball-pad * 2;
    line-height: 1em;
  }
}

.ball-size-ml {
  height: 1em;
  width: 1em;
  line-height: 0;

  i.icon {
    line-height: 0.3;

    &:before {
      font-size: 0.8 - @ball-pad * 2;
      line-height: 1 - @ball-pad * 2;
    }
  }
}

.ball-size-l {
  height: 1.5em;
  width: 1.5em;
  line-height: 1em;

  i.icon:before {
    font-size: 1 - @ball-pad * 2;
    line-height: 1.5 - @ball-pad * 2;
  }
}

.ball-size-xl {
  width: 2em;
  height: 2em;

  i.icon:before {
    line-height: 2 - @ball-pad * 2;
  }
}

.ball-outline(@color) {
  border: @ball-pad solid @color;
}

.ball-solid(@color) {
  background-color: @color;
  color: var(--default-text-color-inverted, @default-text-color-inverted);
  padding: @ball-pad;
}

.state-ball {
  .ball();

  &.state-pending:not(.ball-size-l):not(.ball-size-xl) {
    .ball-solid(var(--state-pending, @state-pending));
  }

  &.state-pending.ball-size-l,
  &.state-pending.ball-size-xl {
    .ball-outline(var(--state-pending, @state-pending));
  }

  &.state-up:not(.ball-size-l):not(.ball-size-xl) {
    .ball-solid(var(--state-up, @state-up));
  }

  &.state-up.ball-size-l,
  &.state-up.ball-size-xl {
    .ball-outline(var(--state-up, @state-up));
  }

  &.state-down {
    .ball-solid(var(--state-down, @state-down));
  }

  &.state-ok:not(.ball-size-l):not(.ball-size-xl) {
    .ball-solid(var(--state-ok, @state-ok));
  }

  &.state-ok.ball-size-l,
  &.state-ok.ball-size-xl {
    .ball-outline(var(--state-ok, @state-ok));
  }

  &.state-warning {
    .ball-solid(var(--state-warning, @state-warning));
  }

  &.state-critical {
    .ball-solid(var(--state-critical, @state-critical));
  }

  &.state-unknown {
    .ball-solid(var(--state-unknown, @state-unknown));
  }

  &.handled {
    opacity: 0.6;
  }

  i.icon {
    text-align: center;
    display: block;

    &::before {
      margin-right: 0;
    }
  }

  // Specific icon styles
  &.ball-size-l i {
    &.fa-sitemap:before {
      font-size: 8px; // px to ignore browser min font-size
    }
  }

  &.ball-size-xl i {
    &.fa-sitemap:before {
      font-size: .857em;
      line-height: (2 - @ball-pad * 2) / .857;
    }
  }
}