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