blob: 18ad3d4dfa871b13d8ef3e613b9abf30914aa345 [file] [log] [blame]
Akron7e5afce2020-08-25 15:50:19 +02001@import "lengths";
2@import "colors";
3
4/**
5 * Definition of form elements for Kalamar.
6 */
Akron59992122019-10-29 11:28:45 +01007
8.form-table {
9 display: block;
10 padding: 0;
Akron0be894f2020-09-21 12:20:08 +020011 font-size: 80%;
Akron59992122019-10-29 11:28:45 +010012
Akron0be894f2020-09-21 12:20:08 +020013 > fieldset {
14 margin-top: 0;
15 }
16
Akron59992122019-10-29 11:28:45 +010017 fieldset {
18 border-width: 0;
19 padding: 0;
Akron0be894f2020-09-21 12:20:08 +020020 margin-top: 1em;
Akron7e5afce2020-08-25 15:50:19 +020021 > div {
22 white-space: nowrap;
23 }
Akron59992122019-10-29 11:28:45 +010024 }
25
26 legend {
27 background-color: transparent;
28 margin-left: 0;
29 font-weight: bold;
30 border-radius: $standard-border-radius;
31 }
32
Akron7e5afce2020-08-25 15:50:19 +020033 label,
34 input[type=radio] {
Akron0be894f2020-09-21 12:20:08 +020035 // font-size: 80%;
Akron59992122019-10-29 11:28:45 +010036 }
37
38 label[for] {
39 display: block;
40 text-align: left;
41 }
42
Akron7e5afce2020-08-25 15:50:19 +020043 label[for],
44 input[type=submit],
45 a.form-button {
Akron59992122019-10-29 11:28:45 +010046 margin-top: 2em;
47 }
48
Akron0be894f2020-09-21 12:20:08 +020049 fieldset.form-line {
50 legend {
51 // float: left;
52 font-size: 100%;
53 display: inline-block;
54 }
55 legend::after {
56 content: ':';
57 color: $ids-green-2;
58 }
59 input, label[for] {
60 display: inline-block;
61 margin: 0;
62 }
63 input {
64 vertical-align: bottom;
65 }
66 label[for] {
67 margin-right: 2em;
68 }
69 }
70
Akron7e5afce2020-08-25 15:50:19 +020071 input,
72 textarea,
73 button,
74 a.form-button {
Akron59992122019-10-29 11:28:45 +010075 border-radius: $standard-border-radius;
76 }
77
Akron7e5afce2020-08-25 15:50:19 +020078 input,
79 textarea {
80 border-color: $ids-grey-2;
Akron59992122019-10-29 11:28:45 +010081 background-color: $nearly-white;
Akron7e5afce2020-08-25 15:50:19 +020082 border-style: solid;
Akron59992122019-10-29 11:28:45 +010083 }
84
Akron7e5afce2020-08-25 15:50:19 +020085 input,
86 textarea,
87 select,
88 a.form-button {
Akron1a9d5be2020-03-19 17:28:33 +010089 border-style: solid;
Akron7e5afce2020-08-25 15:50:19 +020090 display: inline-block;
91 width: 20%;
92 min-width: 20em;
93 padding: $base-padding;
Akron59992122019-10-29 11:28:45 +010094 }
95
96 input[type=radio] {
Akron7e5afce2020-08-25 15:50:19 +020097 display: inline;
Akron548ee672020-10-19 17:41:20 +020098 text-align: right;
Akron59992122019-10-29 11:28:45 +010099 background-color: red;
Akron7e5afce2020-08-25 15:50:19 +0200100 width: auto;
101 min-width: auto;
Akron59992122019-10-29 11:28:45 +0100102 }
103
Akron7e5afce2020-08-25 15:50:19 +0200104 input[readonly=readonly],
105 textarea[readonly] {
106 background-color: $light-orange;
Akron59992122019-10-29 11:28:45 +0100107 }
108
109 .field-with-error {
110 border-color: $ids-pink-1;
111 }
112
Akron1a9d5be2020-03-19 17:28:33 +0100113 input[type=submit],
114 button,
115 a.form-button {
Akron7e5afce2020-08-25 15:50:19 +0200116 display: inline-block;
117 cursor: pointer;
118 border-width: thin;
119 text-align: center;
Akron1a9d5be2020-03-19 17:28:33 +0100120 background-color: $middle-green;
Akron7e5afce2020-08-25 15:50:19 +0200121 border-color: $dark-green;
Akron0be894f2020-09-21 12:20:08 +0200122 // font-size: 8pt;
Akron7e5afce2020-08-25 15:50:19 +0200123 color: $dark-green;
Akron59992122019-10-29 11:28:45 +0100124 }
125
Akron9f2ad342022-05-04 16:16:40 +0200126 span.file-upload {
127 @include choose-item;
128 box-shadow: $choose-box-shadow;
129 border: $choose-border;
130 border-radius: $standard-border-radius;
131 padding: $item-padding;
132 position: relative;
133 overflow: hidden;
134 right: 0;
135 display: inline-block;
136
137 &:hover {
138 @include choose-hover;
139 transition: none;
140 }
141
142 > input[type=file] {
143 position: absolute;
144 top: 0;
145 left: 0;
146 margin: 0;
147 padding: 3em;
148 font-size: 20px;
149 cursor: pointer;
150 opacity: 0;
151 filter: alpha(opacity=0);
152 &.field-with-error {
153 background-color: $ids-pink-1;
154 opacity: .3;
155 filter: alpha(opacity=.3);
156 }
157 }
158
159 &::after {
160 @include icon-font;
161 content: $fa-upload;
162 }
163 }
164
Akron1a9d5be2020-03-19 17:28:33 +0100165 a.form-button:hover {
Akron548ee672020-10-19 17:41:20 +0200166 color: inherit !important;
Akron1a9d5be2020-03-19 17:28:33 +0100167 }
168
Akron59992122019-10-29 11:28:45 +0100169 label.field-required::after {
Akron7e5afce2020-08-25 15:50:19 +0200170 color: $ids-blue-1;
171 content: '*';
Akron59992122019-10-29 11:28:45 +0100172 }
Akron1a9d5be2020-03-19 17:28:33 +0100173}
174
175.button-abort {
176 background-color: $middle-orange !important;
Akron7e5afce2020-08-25 15:50:19 +0200177 color: $darkest-orange !important;
178 border-color: $darkest-orange !important;
179}
180
Akron9f2ad342022-05-04 16:16:40 +0200181button, input[type=submit] {
Akron7e5afce2020-08-25 15:50:19 +0200182 cursor: pointer;
183
184 + button {
185 right: 0;
186 }
187
188 &[type=submit] {
189 @include choose-item;
190 font-weight: normal;
191 padding: 0;
192 height: 100%;
193 top: 0;
194 width: $button-width;
195
196 > span:nth-of-type(1) {
197 @include blind;
198 }
199
200 &::after {
201 font-family: "FontAwesome";
202 }
203
Akron7e5afce2020-08-25 15:50:19 +0200204 &:hover,
205 &:focus {
206 @include choose-hover;
207 }
208
209 &::-moz-focus-inner {
210 border: none;
211 }
212
213 &:active {
214 @include choose-active;
215 }
216
217 /*
218 * This is just for styling the last button,
219 * in case there are more than one buttons.
220 */
221 &:last-of-type {
222 border: {
223 right-width: $border-size;
224 right-style: solid;
225 top-right-radius: $standard-border-radius;
226 bottom-right-radius: $standard-border-radius;
227 }
228 }
229 }
230}
231
Akron9f2ad342022-05-04 16:16:40 +0200232button[type=submit] {
233 border: $border-size solid $nearly-white;
234}
235
236*[type=submit].form-submit {
237 box-shadow: $choose-box-shadow;
238 border-radius: $standard-border-radius;
239 border-width: 2px !important;
240 padding: $base-padding !important;
241}
242
Akron7e5afce2020-08-25 15:50:19 +0200243/**
244 * Checkbox styling
245 * http://stackoverflow.com/questions/4148499/how-to-style-checkbox-using-css
246 */
247.checkbox {
248 display: none;
249
250 + label {
251 cursor: pointer;
252
253 span {
254 display: inline-block;
255 border-radius: 4px;
256 width: 1em;
257 height: 1em;
258 line-height: 1em;
259 vertical-align: middle;
260 padding: 0;
261 margin-right: .2em;
262
263 &::after {
264 @include icon-font;
265 content: $fa-check;
266 }
267 }
268 }
269
270 &:checked + label span::after {
271 content: $fa-checked;
272 }
Akron1a9d5be2020-03-19 17:28:33 +0100273}