blob: 8ee6e66b51be67bba656934d704ab7939d819c8f [file] [log] [blame]
Michael Davis3a0d4712017-03-27 14:01:34 -05001// Drop downs
2.dropdown__button {
3 position: relative;
Yoshie Muranakade382082019-04-30 13:56:10 -05004 padding-top: .5em;
5 padding-bottom: .5em;
6 padding-left: .5em;
7 padding-right: 1.5em;
Michael Davis2d289422017-08-03 13:34:02 -05008 margin-top: 0;
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -05009 border: 1px solid $border-color-02;
Michael Davis51946552017-05-01 10:30:38 -050010 min-width: 70px;
Michael Davis51946552017-05-01 10:30:38 -050011 font-weight: 400;
Yoshie Muranakade382082019-04-30 13:56:10 -050012 @include bgImage__arrowDown-primary;
13 &[disabled] {
14 @include bgImage__arrowDown-disabled;
Michael Davis3a0d4712017-03-27 14:01:34 -050015 }
16}
17
18.dropdown__wrapper {
19 position: relative;
20 display: inline-block;
Michael Davis3a0d4712017-03-27 14:01:34 -050021}
22
23.dropdown__list {
24 position: absolute;
25 z-index: 100;
26 right: 0;
27 top: 100%;
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050028 background: $primary-light;
Michael Davis3a0d4712017-03-27 14:01:34 -050029 padding: 0;
30 width: 100%;
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050031 border: 1px solid $border-color-02;
Michael Davis3a0d4712017-03-27 14:01:34 -050032 margin-top: -5px;
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050033 box-shadow: 0 4px 10px -2px $base-02--02;
Michael Davis3a0d4712017-03-27 14:01:34 -050034 li {
35 list-style-type: none;
36 }
37 button {
38 padding: 1em 1em 1em 1.8em;
39 text-align: left;
40 width: 100%;
Michael Davis51946552017-05-01 10:30:38 -050041 font-weight: 400;
Michael Davis3a0d4712017-03-27 14:01:34 -050042 &:hover {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050043 background: $background-02;
Michael Davis3a0d4712017-03-27 14:01:34 -050044 }
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 Muranaka6f7ec802019-06-24 14:35:41 -050060 color: $primary-accent;
Michael Davis3a0d4712017-03-27 14:01:34 -050061 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 Muranaka6f7ec802019-06-24 14:35:41 -050074 color: $text-01;
Michael Davis3a0d4712017-03-27 14:01:34 -050075 }
76}
77
78
79
80// Checkbox
Michael Davis51946552017-05-01 10:30:38 -050081.control-check,
82.control-radio {
Michael Davis3a0d4712017-03-27 14:01:34 -050083 position: relative;
84 display: inline-block;
85 margin-bottom: 15px;
Michael Davis3a0d4712017-03-27 14:01:34 -050086 padding-top: 7px;
87 cursor: pointer;
Michael Davis51946552017-05-01 10:30:38 -050088 line-height: initial;
Michael Davis3a0d4712017-03-27 14:01:34 -050089}
90
91.control-check input {
92 position: absolute;
93 z-index: -1;
94 opacity: 0;
95}
96
97.control__indicator {
98 position: absolute;
99 top: 2px;
100 left: 0;
101 width: 20px;
102 height: 20px;
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -0500103 background: $primary-light;
104 border: 1px solid $border-color-02;
Michael Davisb8a41c12017-08-14 14:59:46 -0500105 font-size: 0;
Michael Davis3a0d4712017-03-27 14:01:34 -0500106}
107
beccabroek5e258e42018-11-07 12:22:31 -0600108.control__label {
109 display: inline-block;
110 margin-left: 26px;
111 user-select: none;
112}
113
Michael Davis3a0d4712017-03-27 14:01:34 -0500114/* Hover and focus states */
115.control-check:hover input ~ .control__indicator,
116.control-check input:focus ~ .control__indicator {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -0500117 border: 1px solid $primary-accent;
118 background-color: $primary-accent;
Michael Davis3a0d4712017-03-27 14:01:34 -0500119}
120
121/* Checked state */
122.control-check input:checked ~ .control__indicator {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -0500123 background: $primary-accent;
Michael Davis3a0d4712017-03-27 14:01:34 -0500124}
125
126/* Hover state whilst checked */
127.control-check:hover input:not([disabled]):checked ~ .control__indicator {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -0500128 background: $primary-accent;
Michael Davis3a0d4712017-03-27 14:01:34 -0500129}
130
131/* Disabled state */
132.control-check input:disabled ~ .control__indicator {
133 pointer-events: none;
134 opacity: .6;
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -0500135 background: $base-02--04;
136 border: 1px solid $primary-light;
Michael Davis3a0d4712017-03-27 14:01:34 -0500137}
138
139.control-check:hover > input:disabled ~ .control__indicator {
140 outline: 0;
141}
142
143/* Check mark */
144.control__indicator:after,
145.control-check input:not(:checked){
146 position: absolute;
147 display: none;
148 content: '';
149}
150
151/* Show check mark */
152.control-check input:checked ~ .control__indicator:after {
153 display: block;
154}
155
156/* Checkbox tick */
157.control-check .control__indicator:after {
158 top: 3px;
159 left: 7px;
160 width: 5px;
161 height: 10px;
162 transform: rotate(45deg);
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -0500163 border: solid $primary-light;
Michael Davis3a0d4712017-03-27 14:01:34 -0500164 border-width: 0 2px 2px 0;
165}
166
167/* Disabled tick colour */
168.control-check input:disabled ~ .control__indicator:after {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -0500169 border-color: $primary-light;
170 color: $primary-light;
Michael Davis51946552017-05-01 10:30:38 -0500171}
172
173// Radio Buttons
174.control-radio {
175 padding-left: 3em;
176}
177.control-radio.disabled:hover {
178 cursor: default;
179}
180.control-radio .control__indicator {
181 position: absolute;
182 top: 2px;
183 left: 0;
184 width: 30px;
185 height: 30px;
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -0500186 background: $primary-light;
187 border: 2px solid $border-color-02;
Michael Davis51946552017-05-01 10:30:38 -0500188}
189.control-radio input{
190 position: absolute;
191 z-index: -1;
192 opacity: 0;
193}
194
195.control-radio .control__indicator {
196 border-radius: 50%;
197}
198
199/* Hover and focus states */
200.control-radio input:focus ~ .control__indicator {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -0500201 background: $primary-accent;
202 outline: 1px solid $primary-accent;
Michael Davis51946552017-05-01 10:30:38 -0500203 outline-offset: 3px;
204}
205
206.control-radio input:checked ~ .control__indicator {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -0500207 background: $background-02;
208 border: 2px solid $primary-accent;
Michael Davis51946552017-05-01 10:30:38 -0500209}
210
211/* Disabled state */
212.control-radio input:disabled ~ .control__indicator{
213 pointer-events: none;
214 opacity: .6;
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -0500215 background: $base-02--04;
216 border: 1px solid $border-color-01;
Michael Davis51946552017-05-01 10:30:38 -0500217}
218
219.control-radio:hover > input:disabled ~ .control__indicator{
220 outline: 0;
221}
222
223.control-radio:hover input:disabled {
224 cursor: default;
225}
226
227/* mark */
228.control__indicator:after {
229 position: absolute;
230 display: none;
231 content: '';
232}
233
234/* Show mark */
235.control-radio input:checked ~ .control__indicator:after {
236 display: block;
237}
238
239/* Disabled tick colour */
240.control-radio input:disabled ~ .control__indicator:after{
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -0500241 border-color: $primary-light;
242 color: $primary-light;
Michael Davis51946552017-05-01 10:30:38 -0500243}
244
245/* Radio button inner circle */
246.control-radio .control__indicator:after {
247 top: 4px;
248 left: 4px;
249 width: 18px;
250 height: 18px;
251 border-radius: 50%;
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -0500252 background: $primary-accent;
Michael Davis51946552017-05-01 10:30:38 -0500253}
254
255.control-radio:hover .control__indicator:after {
256 display: block;
257}
258
259/* Disabled circle colour */
260.control-radio input:disabled ~ .control__indicator:after {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -0500261 background: $base-02--03;
Michael Davis51946552017-05-01 10:30:38 -0500262 width: 20px;
263 height: 20px;
Michael Davis3a0d4712017-03-27 14:01:34 -0500264}