blob: 61ca4d3fe99845b3a23e344d22d6ac607ee0c60c [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
81
Michael Davis51946552017-05-01 10:30:38 -050082.control-check,
83.control-radio {
Michael Davis3a0d4712017-03-27 14:01:34 -050084 position: relative;
85 display: inline-block;
86 margin-bottom: 15px;
Michael Davis3a0d4712017-03-27 14:01:34 -050087 padding-top: 7px;
88 cursor: pointer;
Michael Davis51946552017-05-01 10:30:38 -050089 line-height: initial;
Michael Davis3a0d4712017-03-27 14:01:34 -050090}
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 Muranaka6f7ec802019-06-24 14:35:41 -0500104 background: $primary-light;
105 border: 1px solid $border-color-02;
Michael Davisb8a41c12017-08-14 14:59:46 -0500106 font-size: 0;
Michael Davis3a0d4712017-03-27 14:01:34 -0500107}
108
Michael Davis3a0d4712017-03-27 14:01:34 -0500109/* Hover and focus states */
110.control-check:hover input ~ .control__indicator,
111.control-check input:focus ~ .control__indicator {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -0500112 border: 1px solid $primary-accent;
113 background-color: $primary-accent;
Michael Davis3a0d4712017-03-27 14:01:34 -0500114}
115
116/* Checked state */
117.control-check input:checked ~ .control__indicator {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -0500118 background: $primary-accent;
Michael Davis3a0d4712017-03-27 14:01:34 -0500119}
120
121/* Hover state whilst checked */
122.control-check:hover input:not([disabled]):checked ~ .control__indicator {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -0500123 background: $primary-accent;
Michael Davis3a0d4712017-03-27 14:01:34 -0500124}
125
126/* Disabled state */
127.control-check input:disabled ~ .control__indicator {
128 pointer-events: none;
129 opacity: .6;
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -0500130 background: $base-02--04;
131 border: 1px solid $primary-light;
Michael Davis3a0d4712017-03-27 14:01:34 -0500132}
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 Muranaka6f7ec802019-06-24 14:35:41 -0500158 border: solid $primary-light;
Michael Davis3a0d4712017-03-27 14:01:34 -0500159 border-width: 0 2px 2px 0;
160}
161
162/* Disabled tick colour */
163.control-check input:disabled ~ .control__indicator:after {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -0500164 border-color: $primary-light;
165 color: $primary-light;
Michael Davis51946552017-05-01 10:30:38 -0500166}
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 Muranaka6f7ec802019-06-24 14:35:41 -0500181 background: $primary-light;
182 border: 2px solid $border-color-02;
Michael Davis51946552017-05-01 10:30:38 -0500183}
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 Muranaka6f7ec802019-06-24 14:35:41 -0500196 background: $primary-accent;
197 outline: 1px solid $primary-accent;
Michael Davis51946552017-05-01 10:30:38 -0500198 outline-offset: 3px;
199}
200
201.control-radio input:checked ~ .control__indicator {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -0500202 background: $background-02;
203 border: 2px solid $primary-accent;
Michael Davis51946552017-05-01 10:30:38 -0500204}
205
206/* Disabled state */
207.control-radio input:disabled ~ .control__indicator{
208 pointer-events: none;
209 opacity: .6;
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -0500210 background: $base-02--04;
211 border: 1px solid $border-color-01;
Michael Davis51946552017-05-01 10:30:38 -0500212}
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 Muranaka6f7ec802019-06-24 14:35:41 -0500236 border-color: $primary-light;
237 color: $primary-light;
Michael Davis51946552017-05-01 10:30:38 -0500238}
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 Muranaka6f7ec802019-06-24 14:35:41 -0500247 background: $primary-accent;
Michael Davis51946552017-05-01 10:30:38 -0500248}
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 Muranaka6f7ec802019-06-24 14:35:41 -0500256 background: $base-02--03;
Michael Davis51946552017-05-01 10:30:38 -0500257 width: 20px;
258 height: 20px;
Michael Davis3a0d4712017-03-27 14:01:34 -0500259}