blob: 70e6bcf6dbbaade2fd9ee8ea4d3467ef785b0479 [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 }
Helge9f9d4852024-12-09 16:06:34 +0100173
174 span.field-required{
175 color: $ids-blue-1;
176 }
177
Akron1a9d5be2020-03-19 17:28:33 +0100178}
179
180.button-abort {
181 background-color: $middle-orange !important;
Akron7e5afce2020-08-25 15:50:19 +0200182 color: $darkest-orange !important;
183 border-color: $darkest-orange !important;
184}
185
Akron9f2ad342022-05-04 16:16:40 +0200186button, input[type=submit] {
Akron7e5afce2020-08-25 15:50:19 +0200187 cursor: pointer;
188
189 + button {
190 right: 0;
191 }
192
193 &[type=submit] {
194 @include choose-item;
195 font-weight: normal;
196 padding: 0;
197 height: 100%;
198 top: 0;
199 width: $button-width;
200
201 > span:nth-of-type(1) {
202 @include blind;
203 }
204
205 &::after {
206 font-family: "FontAwesome";
207 }
208
Akron7e5afce2020-08-25 15:50:19 +0200209 &:hover,
210 &:focus {
211 @include choose-hover;
212 }
213
214 &::-moz-focus-inner {
215 border: none;
216 }
217
218 &:active {
219 @include choose-active;
220 }
221
222 /*
223 * This is just for styling the last button,
224 * in case there are more than one buttons.
225 */
226 &:last-of-type {
227 border: {
228 right-width: $border-size;
229 right-style: solid;
230 top-right-radius: $standard-border-radius;
231 bottom-right-radius: $standard-border-radius;
232 }
233 }
234 }
235}
236
Akron9f2ad342022-05-04 16:16:40 +0200237button[type=submit] {
238 border: $border-size solid $nearly-white;
239}
240
241*[type=submit].form-submit {
242 box-shadow: $choose-box-shadow;
243 border-radius: $standard-border-radius;
244 border-width: 2px !important;
245 padding: $base-padding !important;
246}
247
Akron7e5afce2020-08-25 15:50:19 +0200248/**
249 * Checkbox styling
250 * http://stackoverflow.com/questions/4148499/how-to-style-checkbox-using-css
251 */
252.checkbox {
253 display: none;
254
255 + label {
256 cursor: pointer;
257
258 span {
259 display: inline-block;
260 border-radius: 4px;
261 width: 1em;
262 height: 1em;
263 line-height: 1em;
264 vertical-align: middle;
265 padding: 0;
266 margin-right: .2em;
267
268 &::after {
269 @include icon-font;
270 content: $fa-check;
271 }
272 }
273 }
274
275 &:checked + label span::after {
276 content: $fa-checked;
277 }
Akron1a9d5be2020-03-19 17:28:33 +0100278}