Michael Davis | 3a0d471 | 2017-03-27 14:01:34 -0500 | [diff] [blame] | 1 | // Drop downs |
| 2 | .dropdown__button { |
| 3 | position: relative; |
Yoshie Muranaka | de38208 | 2019-04-30 13:56:10 -0500 | [diff] [blame] | 4 | padding-top: .5em; |
| 5 | padding-bottom: .5em; |
| 6 | padding-left: .5em; |
| 7 | padding-right: 1.5em; |
Michael Davis | 2d28942 | 2017-08-03 13:34:02 -0500 | [diff] [blame] | 8 | margin-top: 0; |
Yoshie Muranaka | 6f7ec80 | 2019-06-24 14:35:41 -0500 | [diff] [blame] | 9 | border: 1px solid $border-color-02; |
Michael Davis | 5194655 | 2017-05-01 10:30:38 -0500 | [diff] [blame] | 10 | min-width: 70px; |
Michael Davis | 5194655 | 2017-05-01 10:30:38 -0500 | [diff] [blame] | 11 | font-weight: 400; |
Yoshie Muranaka | de38208 | 2019-04-30 13:56:10 -0500 | [diff] [blame] | 12 | @include bgImage__arrowDown-primary; |
| 13 | &[disabled] { |
| 14 | @include bgImage__arrowDown-disabled; |
Michael Davis | 3a0d471 | 2017-03-27 14:01:34 -0500 | [diff] [blame] | 15 | } |
| 16 | } |
| 17 | |
| 18 | .dropdown__wrapper { |
| 19 | position: relative; |
| 20 | display: inline-block; |
Michael Davis | 3a0d471 | 2017-03-27 14:01:34 -0500 | [diff] [blame] | 21 | } |
| 22 | |
| 23 | .dropdown__list { |
| 24 | position: absolute; |
| 25 | z-index: 100; |
| 26 | right: 0; |
| 27 | top: 100%; |
Yoshie Muranaka | 6f7ec80 | 2019-06-24 14:35:41 -0500 | [diff] [blame] | 28 | background: $primary-light; |
Michael Davis | 3a0d471 | 2017-03-27 14:01:34 -0500 | [diff] [blame] | 29 | padding: 0; |
| 30 | width: 100%; |
Yoshie Muranaka | 6f7ec80 | 2019-06-24 14:35:41 -0500 | [diff] [blame] | 31 | border: 1px solid $border-color-02; |
Michael Davis | 3a0d471 | 2017-03-27 14:01:34 -0500 | [diff] [blame] | 32 | margin-top: -5px; |
Yoshie Muranaka | 6f7ec80 | 2019-06-24 14:35:41 -0500 | [diff] [blame] | 33 | box-shadow: 0 4px 10px -2px $base-02--02; |
Michael Davis | 3a0d471 | 2017-03-27 14:01:34 -0500 | [diff] [blame] | 34 | li { |
| 35 | list-style-type: none; |
| 36 | } |
| 37 | button { |
| 38 | padding: 1em 1em 1em 1.8em; |
| 39 | text-align: left; |
| 40 | width: 100%; |
Michael Davis | 5194655 | 2017-05-01 10:30:38 -0500 | [diff] [blame] | 41 | font-weight: 400; |
Michael Davis | 3a0d471 | 2017-03-27 14:01:34 -0500 | [diff] [blame] | 42 | &:hover { |
Yoshie Muranaka | 6f7ec80 | 2019-06-24 14:35:41 -0500 | [diff] [blame] | 43 | background: $background-02; |
Michael Davis | 3a0d471 | 2017-03-27 14:01:34 -0500 | [diff] [blame] | 44 | } |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | .dropdown__list { |
| 49 | min-width: 230px; |
| 50 | } |
| 51 | .dropdown__list.multi-select { |
| 52 | > .active { |
| 53 | position: relative; |
| 54 | &:before { |
| 55 | content: '\2713'; |
| 56 | position: absolute; |
| 57 | display: inline-block; |
| 58 | top: 50%; |
| 59 | left: .6em; |
Yoshie Muranaka | 6f7ec80 | 2019-06-24 14:35:41 -0500 | [diff] [blame] | 60 | color: $primary-accent; |
Michael Davis | 3a0d471 | 2017-03-27 14:01:34 -0500 | [diff] [blame] | 61 | transform: translateY(-50%); |
| 62 | } |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | .dropdown__date { |
| 67 | width: 430px; |
| 68 | .row { |
| 69 | padding: 1em; |
| 70 | margin-right: 0; |
| 71 | } |
| 72 | input { |
| 73 | max-width: 170px; |
Yoshie Muranaka | 6f7ec80 | 2019-06-24 14:35:41 -0500 | [diff] [blame] | 74 | color: $text-01; |
Michael Davis | 3a0d471 | 2017-03-27 14:01:34 -0500 | [diff] [blame] | 75 | } |
| 76 | } |
| 77 | |
| 78 | |
| 79 | |
| 80 | // Checkbox |
| 81 | |
Michael Davis | 5194655 | 2017-05-01 10:30:38 -0500 | [diff] [blame] | 82 | .control-check, |
| 83 | .control-radio { |
Michael Davis | 3a0d471 | 2017-03-27 14:01:34 -0500 | [diff] [blame] | 84 | position: relative; |
| 85 | display: inline-block; |
| 86 | margin-bottom: 15px; |
Michael Davis | 3a0d471 | 2017-03-27 14:01:34 -0500 | [diff] [blame] | 87 | padding-top: 7px; |
| 88 | cursor: pointer; |
Michael Davis | 5194655 | 2017-05-01 10:30:38 -0500 | [diff] [blame] | 89 | line-height: initial; |
Michael Davis | 3a0d471 | 2017-03-27 14:01:34 -0500 | [diff] [blame] | 90 | } |
| 91 | |
| 92 | .control-check input { |
| 93 | position: absolute; |
| 94 | z-index: -1; |
| 95 | opacity: 0; |
| 96 | } |
| 97 | |
| 98 | .control__indicator { |
| 99 | position: absolute; |
| 100 | top: 2px; |
| 101 | left: 0; |
| 102 | width: 20px; |
| 103 | height: 20px; |
Yoshie Muranaka | 6f7ec80 | 2019-06-24 14:35:41 -0500 | [diff] [blame] | 104 | background: $primary-light; |
| 105 | border: 1px solid $border-color-02; |
Michael Davis | b8a41c1 | 2017-08-14 14:59:46 -0500 | [diff] [blame] | 106 | font-size: 0; |
Michael Davis | 3a0d471 | 2017-03-27 14:01:34 -0500 | [diff] [blame] | 107 | } |
| 108 | |
Michael Davis | 3a0d471 | 2017-03-27 14:01:34 -0500 | [diff] [blame] | 109 | /* Hover and focus states */ |
| 110 | .control-check:hover input ~ .control__indicator, |
| 111 | .control-check input:focus ~ .control__indicator { |
Yoshie Muranaka | 6f7ec80 | 2019-06-24 14:35:41 -0500 | [diff] [blame] | 112 | border: 1px solid $primary-accent; |
| 113 | background-color: $primary-accent; |
Michael Davis | 3a0d471 | 2017-03-27 14:01:34 -0500 | [diff] [blame] | 114 | } |
| 115 | |
| 116 | /* Checked state */ |
| 117 | .control-check input:checked ~ .control__indicator { |
Yoshie Muranaka | 6f7ec80 | 2019-06-24 14:35:41 -0500 | [diff] [blame] | 118 | background: $primary-accent; |
Michael Davis | 3a0d471 | 2017-03-27 14:01:34 -0500 | [diff] [blame] | 119 | } |
| 120 | |
| 121 | /* Hover state whilst checked */ |
| 122 | .control-check:hover input:not([disabled]):checked ~ .control__indicator { |
Yoshie Muranaka | 6f7ec80 | 2019-06-24 14:35:41 -0500 | [diff] [blame] | 123 | background: $primary-accent; |
Michael Davis | 3a0d471 | 2017-03-27 14:01:34 -0500 | [diff] [blame] | 124 | } |
| 125 | |
| 126 | /* Disabled state */ |
| 127 | .control-check input:disabled ~ .control__indicator { |
| 128 | pointer-events: none; |
| 129 | opacity: .6; |
Yoshie Muranaka | 6f7ec80 | 2019-06-24 14:35:41 -0500 | [diff] [blame] | 130 | background: $base-02--04; |
| 131 | border: 1px solid $primary-light; |
Michael Davis | 3a0d471 | 2017-03-27 14:01:34 -0500 | [diff] [blame] | 132 | } |
| 133 | |
| 134 | .control-check:hover > input:disabled ~ .control__indicator { |
| 135 | outline: 0; |
| 136 | } |
| 137 | |
| 138 | /* Check mark */ |
| 139 | .control__indicator:after, |
| 140 | .control-check input:not(:checked){ |
| 141 | position: absolute; |
| 142 | display: none; |
| 143 | content: ''; |
| 144 | } |
| 145 | |
| 146 | /* Show check mark */ |
| 147 | .control-check input:checked ~ .control__indicator:after { |
| 148 | display: block; |
| 149 | } |
| 150 | |
| 151 | /* Checkbox tick */ |
| 152 | .control-check .control__indicator:after { |
| 153 | top: 3px; |
| 154 | left: 7px; |
| 155 | width: 5px; |
| 156 | height: 10px; |
| 157 | transform: rotate(45deg); |
Yoshie Muranaka | 6f7ec80 | 2019-06-24 14:35:41 -0500 | [diff] [blame] | 158 | border: solid $primary-light; |
Michael Davis | 3a0d471 | 2017-03-27 14:01:34 -0500 | [diff] [blame] | 159 | border-width: 0 2px 2px 0; |
| 160 | } |
| 161 | |
| 162 | /* Disabled tick colour */ |
| 163 | .control-check input:disabled ~ .control__indicator:after { |
Yoshie Muranaka | 6f7ec80 | 2019-06-24 14:35:41 -0500 | [diff] [blame] | 164 | border-color: $primary-light; |
| 165 | color: $primary-light; |
Michael Davis | 5194655 | 2017-05-01 10:30:38 -0500 | [diff] [blame] | 166 | } |
| 167 | |
| 168 | // Radio Buttons |
| 169 | .control-radio { |
| 170 | padding-left: 3em; |
| 171 | } |
| 172 | .control-radio.disabled:hover { |
| 173 | cursor: default; |
| 174 | } |
| 175 | .control-radio .control__indicator { |
| 176 | position: absolute; |
| 177 | top: 2px; |
| 178 | left: 0; |
| 179 | width: 30px; |
| 180 | height: 30px; |
Yoshie Muranaka | 6f7ec80 | 2019-06-24 14:35:41 -0500 | [diff] [blame] | 181 | background: $primary-light; |
| 182 | border: 2px solid $border-color-02; |
Michael Davis | 5194655 | 2017-05-01 10:30:38 -0500 | [diff] [blame] | 183 | } |
| 184 | .control-radio input{ |
| 185 | position: absolute; |
| 186 | z-index: -1; |
| 187 | opacity: 0; |
| 188 | } |
| 189 | |
| 190 | .control-radio .control__indicator { |
| 191 | border-radius: 50%; |
| 192 | } |
| 193 | |
| 194 | /* Hover and focus states */ |
| 195 | .control-radio input:focus ~ .control__indicator { |
Yoshie Muranaka | 6f7ec80 | 2019-06-24 14:35:41 -0500 | [diff] [blame] | 196 | background: $primary-accent; |
| 197 | outline: 1px solid $primary-accent; |
Michael Davis | 5194655 | 2017-05-01 10:30:38 -0500 | [diff] [blame] | 198 | outline-offset: 3px; |
| 199 | } |
| 200 | |
| 201 | .control-radio input:checked ~ .control__indicator { |
Yoshie Muranaka | 6f7ec80 | 2019-06-24 14:35:41 -0500 | [diff] [blame] | 202 | background: $background-02; |
| 203 | border: 2px solid $primary-accent; |
Michael Davis | 5194655 | 2017-05-01 10:30:38 -0500 | [diff] [blame] | 204 | } |
| 205 | |
| 206 | /* Disabled state */ |
| 207 | .control-radio input:disabled ~ .control__indicator{ |
| 208 | pointer-events: none; |
| 209 | opacity: .6; |
Yoshie Muranaka | 6f7ec80 | 2019-06-24 14:35:41 -0500 | [diff] [blame] | 210 | background: $base-02--04; |
| 211 | border: 1px solid $border-color-01; |
Michael Davis | 5194655 | 2017-05-01 10:30:38 -0500 | [diff] [blame] | 212 | } |
| 213 | |
| 214 | .control-radio:hover > input:disabled ~ .control__indicator{ |
| 215 | outline: 0; |
| 216 | } |
| 217 | |
| 218 | .control-radio:hover input:disabled { |
| 219 | cursor: default; |
| 220 | } |
| 221 | |
| 222 | /* mark */ |
| 223 | .control__indicator:after { |
| 224 | position: absolute; |
| 225 | display: none; |
| 226 | content: ''; |
| 227 | } |
| 228 | |
| 229 | /* Show mark */ |
| 230 | .control-radio input:checked ~ .control__indicator:after { |
| 231 | display: block; |
| 232 | } |
| 233 | |
| 234 | /* Disabled tick colour */ |
| 235 | .control-radio input:disabled ~ .control__indicator:after{ |
Yoshie Muranaka | 6f7ec80 | 2019-06-24 14:35:41 -0500 | [diff] [blame] | 236 | border-color: $primary-light; |
| 237 | color: $primary-light; |
Michael Davis | 5194655 | 2017-05-01 10:30:38 -0500 | [diff] [blame] | 238 | } |
| 239 | |
| 240 | /* Radio button inner circle */ |
| 241 | .control-radio .control__indicator:after { |
| 242 | top: 4px; |
| 243 | left: 4px; |
| 244 | width: 18px; |
| 245 | height: 18px; |
| 246 | border-radius: 50%; |
Yoshie Muranaka | 6f7ec80 | 2019-06-24 14:35:41 -0500 | [diff] [blame] | 247 | background: $primary-accent; |
Michael Davis | 5194655 | 2017-05-01 10:30:38 -0500 | [diff] [blame] | 248 | } |
| 249 | |
| 250 | .control-radio:hover .control__indicator:after { |
| 251 | display: block; |
| 252 | } |
| 253 | |
| 254 | /* Disabled circle colour */ |
| 255 | .control-radio input:disabled ~ .control__indicator:after { |
Yoshie Muranaka | 6f7ec80 | 2019-06-24 14:35:41 -0500 | [diff] [blame] | 256 | background: $base-02--03; |
Michael Davis | 5194655 | 2017-05-01 10:30:38 -0500 | [diff] [blame] | 257 | width: 20px; |
| 258 | height: 20px; |
Michael Davis | 3a0d471 | 2017-03-27 14:01:34 -0500 | [diff] [blame] | 259 | } |