|
| 1 | +@ball-pad: 1/6em; |
| 2 | + |
| 3 | +.ball { |
| 4 | + border-radius: 50%; |
| 5 | + display: inline-block; |
| 6 | + text-align: center; |
| 7 | +} |
| 8 | + |
| 9 | +.ball-size-xs { |
| 10 | + height: 1/3em; |
| 11 | + width: 1/3em; |
| 12 | +} |
| 13 | + |
| 14 | +.ball-size-s { |
| 15 | + height: 0.5em; |
| 16 | + width: 0.5em; |
| 17 | +} |
| 18 | + |
| 19 | +.ball-size-m { |
| 20 | + height: 0.75em; |
| 21 | + width: 0.75em; |
| 22 | + line-height: 0; |
| 23 | + |
| 24 | + i.icon:before { |
| 25 | + font-size: .75 - @ball-pad * 2; |
| 26 | + line-height: 1em; |
| 27 | + } |
| 28 | +} |
| 29 | + |
| 30 | +.ball-size-ml { |
| 31 | + height: 1em; |
| 32 | + width: 1em; |
| 33 | + line-height: 0; |
| 34 | + |
| 35 | + i.icon { |
| 36 | + line-height: 0.3; |
| 37 | + |
| 38 | + &:before { |
| 39 | + font-size: 0.8 - @ball-pad * 2; |
| 40 | + line-height: 1 - @ball-pad * 2; |
| 41 | + } |
| 42 | + } |
| 43 | +} |
| 44 | + |
| 45 | +.ball-size-l { |
| 46 | + height: 1.5em; |
| 47 | + width: 1.5em; |
| 48 | + line-height: 1em; |
| 49 | + |
| 50 | + i.icon:before { |
| 51 | + font-size: 1 - @ball-pad * 2; |
| 52 | + line-height: 1.5 - @ball-pad * 2; |
| 53 | + } |
| 54 | +} |
| 55 | + |
| 56 | +.ball-size-xl { |
| 57 | + width: 2em; |
| 58 | + height: 2em; |
| 59 | + |
| 60 | + i.icon:before { |
| 61 | + line-height: 2 - @ball-pad * 2; |
| 62 | + } |
| 63 | +} |
| 64 | + |
| 65 | +.ball-outline(@color) { |
| 66 | + border: @ball-pad solid @color; |
| 67 | + color: @color; |
| 68 | +} |
| 69 | + |
| 70 | +.ball-solid(@color) { |
| 71 | + background-color: @color; |
| 72 | + color: var(--default-text-color-inverted, @default-text-color-inverted); |
| 73 | + padding: @ball-pad; |
| 74 | +} |
| 75 | + |
| 76 | +.state-ball { |
| 77 | + .ball(); |
| 78 | + |
| 79 | + &.state-pending { |
| 80 | + .ball-solid(var(--state-pending, @state-pending)); |
| 81 | + } |
| 82 | + |
| 83 | + &.state-up:not(.ball-size-l):not(.ball-size-xl) { |
| 84 | + .ball-solid(var(--state-up, @state-up)); |
| 85 | + } |
| 86 | + |
| 87 | + &.state-up.ball-size-l, |
| 88 | + &.state-up.ball-size-xl { |
| 89 | + .ball-outline(var(--state-up, @state-up)); |
| 90 | + } |
| 91 | + |
| 92 | + &.state-down { |
| 93 | + .ball-solid(var(--state-down, @state-down)); |
| 94 | + } |
| 95 | + |
| 96 | + &.state-ok:not(.ball-size-l):not(.ball-size-xl) { |
| 97 | + .ball-solid(var(--state-ok, @state-ok)); |
| 98 | + } |
| 99 | + |
| 100 | + &.state-ok.ball-size-l, |
| 101 | + &.state-ok.ball-size-xl { |
| 102 | + .ball-outline(var(--state-ok, @state-ok)); |
| 103 | + } |
| 104 | + |
| 105 | + &.state-warning { |
| 106 | + .ball-solid(var(--state-warning, @state-warning)); |
| 107 | + } |
| 108 | + |
| 109 | + &.state-critical { |
| 110 | + .ball-solid(var(--state-critical, @state-critical)); |
| 111 | + } |
| 112 | + |
| 113 | + &.state-unknown { |
| 114 | + .ball-solid(var(--state-unknown, @state-unknown)); |
| 115 | + } |
| 116 | + |
| 117 | + &.handled { |
| 118 | + opacity: 0.6; |
| 119 | + } |
| 120 | + |
| 121 | + i { |
| 122 | + text-align: center; |
| 123 | + display: block; |
| 124 | + |
| 125 | + &:before { |
| 126 | + margin-right: 0; |
| 127 | + } |
| 128 | + } |
| 129 | + |
| 130 | + // Specific icon styles |
| 131 | + &.ball-size-l i { |
| 132 | + &.fa-sitemap:before { |
| 133 | + font-size: 8px; // px to ignore browser min font-size |
| 134 | + } |
| 135 | + } |
| 136 | + |
| 137 | + &.ball-size-xl i { |
| 138 | + &.fa-sitemap:before { |
| 139 | + font-size: .857em; |
| 140 | + line-height: (2 - @ball-pad * 2) / .857; |
| 141 | + } |
| 142 | + } |
| 143 | +} |
0 commit comments