|
| 1 | +/* |
| 2 | +Copyright 2020 The Matrix.org Foundation C.I.C. |
| 3 | +
|
| 4 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +you may not use this file except in compliance with the License. |
| 6 | +You may obtain a copy of the License at |
| 7 | +
|
| 8 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +
|
| 10 | +Unless required by applicable law or agreed to in writing, software |
| 11 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +See the License for the specific language governing permissions and |
| 14 | +limitations under the License. |
| 15 | +*/ |
| 16 | + |
| 17 | +.mx_Slider { |
| 18 | + position: relative; |
| 19 | + margin: 0px; |
| 20 | + flex-grow: 1; |
| 21 | +} |
| 22 | + |
| 23 | +.mx_Slider_dotContainer { |
| 24 | + display: flex; |
| 25 | + flex-direction: row; |
| 26 | + justify-content: space-between; |
| 27 | +} |
| 28 | + |
| 29 | +.mx_Slider_bar { |
| 30 | + display: flex; |
| 31 | + box-sizing: border-box; |
| 32 | + position: absolute; |
| 33 | + height: 1em; |
| 34 | + width: 100%; |
| 35 | + padding: 0 0.5em; // half the width of a dot. |
| 36 | + align-items: center; |
| 37 | +} |
| 38 | + |
| 39 | +.mx_Slider_bar > hr { |
| 40 | + width: 100%; |
| 41 | + height: 0.4em; |
| 42 | + background-color: $slider-background-color; |
| 43 | + border: 0; |
| 44 | +} |
| 45 | + |
| 46 | +.mx_Slider_selection { |
| 47 | + display: flex; |
| 48 | + align-items: center; |
| 49 | + width: calc(100% - 1em); // 2 * half the width of a dot |
| 50 | + height: 1em; |
| 51 | + position: absolute; |
| 52 | + pointer-events: none; |
| 53 | +} |
| 54 | + |
| 55 | +.mx_Slider_selectionDot { |
| 56 | + position: absolute; |
| 57 | + width: 1.1em; |
| 58 | + height: 1.1em; |
| 59 | + background-color: $slider-selection-color; |
| 60 | + border-radius: 50%; |
| 61 | + box-shadow: 0 0 6px lightgrey; |
| 62 | + z-index: 10; |
| 63 | +} |
| 64 | + |
| 65 | +.mx_Slider_selection > hr { |
| 66 | + margin: 0; |
| 67 | + border: 0.2em solid $slider-selection-color; |
| 68 | +} |
| 69 | + |
| 70 | +.mx_Slider_dot { |
| 71 | + height: 1em; |
| 72 | + width: 1em; |
| 73 | + border-radius: 50%; |
| 74 | + background-color: $slider-background-color; |
| 75 | + z-index: 0; |
| 76 | +} |
| 77 | + |
| 78 | +.mx_Slider_dotActive { |
| 79 | + background-color: $slider-selection-color; |
| 80 | +} |
| 81 | + |
| 82 | +.mx_Slider_dotValue { |
| 83 | + display: flex; |
| 84 | + flex-direction: column; |
| 85 | + align-items: center; |
| 86 | + color: $slider-background-color; |
| 87 | +} |
| 88 | + |
| 89 | +// The following is a hack to center the labels without adding |
| 90 | +// any width to the slider's dots. |
| 91 | +.mx_Slider_labelContainer { |
| 92 | + width: 1em; |
| 93 | +} |
| 94 | + |
| 95 | +.mx_Slider_label { |
| 96 | + position: relative; |
| 97 | + width: fit-content; |
| 98 | + left: -50%; |
| 99 | +} |
0 commit comments