blob: a150e3bee6c6b548487efafc20637b7f41520e85 [file] [log] [blame]
Akron7636edf2025-11-04 12:44:53 +01001@use "lengths";
2@use "colors";
3@use "choose";
4@use "icons";
5@use "mixins";
Akron7e5afce2020-08-25 15:50:19 +02006
7/**
8 * Definition of form elements for Kalamar.
9 */
Akron59992122019-10-29 11:28:45 +010010
11.form-table {
12 display: block;
13 padding: 0;
Akron0be894f2020-09-21 12:20:08 +020014 font-size: 80%;
Akron59992122019-10-29 11:28:45 +010015
Akron0be894f2020-09-21 12:20:08 +020016 > fieldset {
17 margin-top: 0;
18 }
19
Akron59992122019-10-29 11:28:45 +010020 fieldset {
21 border-width: 0;
22 padding: 0;
Akron0be894f2020-09-21 12:20:08 +020023 margin-top: 1em;
Akron7e5afce2020-08-25 15:50:19 +020024 > div {
25 white-space: nowrap;
26 }
Akron59992122019-10-29 11:28:45 +010027 }
28
29 legend {
30 background-color: transparent;
31 margin-left: 0;
32 font-weight: bold;
Akron7636edf2025-11-04 12:44:53 +010033 border-radius: lengths.$standard-border-radius;
Akron59992122019-10-29 11:28:45 +010034 }
35
Akron7e5afce2020-08-25 15:50:19 +020036 label,
37 input[type=radio] {
Akron0be894f2020-09-21 12:20:08 +020038 // font-size: 80%;
Akron59992122019-10-29 11:28:45 +010039 }
40
41 label[for] {
42 display: block;
43 text-align: left;
44 }
45
Akron7e5afce2020-08-25 15:50:19 +020046 label[for],
47 input[type=submit],
48 a.form-button {
Akron59992122019-10-29 11:28:45 +010049 margin-top: 2em;
50 }
51
Akron0be894f2020-09-21 12:20:08 +020052 fieldset.form-line {
53 legend {
54 // float: left;
55 font-size: 100%;
56 display: inline-block;
57 }
58 legend::after {
59 content: ':';
Akron7636edf2025-11-04 12:44:53 +010060 color: colors.$ids-green-2;
Akron0be894f2020-09-21 12:20:08 +020061 }
62 input, label[for] {
63 display: inline-block;
64 margin: 0;
65 }
66 input {
67 vertical-align: bottom;
68 }
69 label[for] {
70 margin-right: 2em;
71 }
72 }
73
Akron7e5afce2020-08-25 15:50:19 +020074 input,
75 textarea,
76 button,
77 a.form-button {
Akron7636edf2025-11-04 12:44:53 +010078 border-radius: lengths.$standard-border-radius;
Akron59992122019-10-29 11:28:45 +010079 }
80
Akron7e5afce2020-08-25 15:50:19 +020081 input,
82 textarea {
Akron7636edf2025-11-04 12:44:53 +010083 border-color: colors.$ids-grey-2;
84 background-color: colors.$nearly-white;
Akron7e5afce2020-08-25 15:50:19 +020085 border-style: solid;
Akron59992122019-10-29 11:28:45 +010086 }
87
Akron7e5afce2020-08-25 15:50:19 +020088 input,
89 textarea,
90 select,
91 a.form-button {
Akron1a9d5be2020-03-19 17:28:33 +010092 border-style: solid;
Akron7e5afce2020-08-25 15:50:19 +020093 display: inline-block;
94 width: 20%;
95 min-width: 20em;
Akron7636edf2025-11-04 12:44:53 +010096 padding: lengths.$base-padding;
Akron59992122019-10-29 11:28:45 +010097 }
98
99 input[type=radio] {
Akron7e5afce2020-08-25 15:50:19 +0200100 display: inline;
Akron548ee672020-10-19 17:41:20 +0200101 text-align: right;
Akron59992122019-10-29 11:28:45 +0100102 background-color: red;
Akron7e5afce2020-08-25 15:50:19 +0200103 width: auto;
104 min-width: auto;
Akron59992122019-10-29 11:28:45 +0100105 }
106
Akron7e5afce2020-08-25 15:50:19 +0200107 input[readonly=readonly],
108 textarea[readonly] {
Akron7636edf2025-11-04 12:44:53 +0100109 background-color: colors.$light-orange;
Akron59992122019-10-29 11:28:45 +0100110 }
111
112 .field-with-error {
Akron7636edf2025-11-04 12:44:53 +0100113 border-color: colors.$ids-pink-1;
Akron59992122019-10-29 11:28:45 +0100114 }
115
Akron1a9d5be2020-03-19 17:28:33 +0100116 input[type=submit],
117 button,
118 a.form-button {
Akron7e5afce2020-08-25 15:50:19 +0200119 display: inline-block;
120 cursor: pointer;
121 border-width: thin;
122 text-align: center;
Akron7636edf2025-11-04 12:44:53 +0100123 background-color: colors.$middle-green;
124 border-color: colors.$dark-green;
Akron0be894f2020-09-21 12:20:08 +0200125 // font-size: 8pt;
Akron7636edf2025-11-04 12:44:53 +0100126 color: colors.$dark-green;
Akron59992122019-10-29 11:28:45 +0100127 }
128
Akron9f2ad342022-05-04 16:16:40 +0200129 span.file-upload {
Akron7636edf2025-11-04 12:44:53 +0100130 @include choose.choose-item;
131 box-shadow: choose.$choose-box-shadow;
132 border: choose.$choose-border;
133 border-radius: lengths.$standard-border-radius;
134 padding: lengths.$item-padding;
Akron9f2ad342022-05-04 16:16:40 +0200135 position: relative;
136 overflow: hidden;
137 right: 0;
138 display: inline-block;
139
140 &:hover {
Akron7636edf2025-11-04 12:44:53 +0100141 @include choose.choose-hover;
Akron9f2ad342022-05-04 16:16:40 +0200142 transition: none;
143 }
144
145 > input[type=file] {
146 position: absolute;
147 top: 0;
148 left: 0;
149 margin: 0;
150 padding: 3em;
151 font-size: 20px;
152 cursor: pointer;
153 opacity: 0;
154 filter: alpha(opacity=0);
155 &.field-with-error {
Akron7636edf2025-11-04 12:44:53 +0100156 background-color: colors.$ids-pink-1;
Akron9f2ad342022-05-04 16:16:40 +0200157 opacity: .3;
158 filter: alpha(opacity=.3);
159 }
160 }
161
162 &::after {
Akron7636edf2025-11-04 12:44:53 +0100163 @include mixins.icon-font;
164 content: icons.$fa-upload;
Akron9f2ad342022-05-04 16:16:40 +0200165 }
166 }
167
Akron1a9d5be2020-03-19 17:28:33 +0100168 a.form-button:hover {
Akron548ee672020-10-19 17:41:20 +0200169 color: inherit !important;
Akron1a9d5be2020-03-19 17:28:33 +0100170 }
171
Akron59992122019-10-29 11:28:45 +0100172 label.field-required::after {
Akron7636edf2025-11-04 12:44:53 +0100173 color: colors.$ids-blue-1;
Akron7e5afce2020-08-25 15:50:19 +0200174 content: '*';
Akron59992122019-10-29 11:28:45 +0100175 }
Helge9f9d4852024-12-09 16:06:34 +0100176
177 span.field-required{
Akron7636edf2025-11-04 12:44:53 +0100178 color: colors.$ids-blue-1;
Helge9f9d4852024-12-09 16:06:34 +0100179 }
180
Akron1a9d5be2020-03-19 17:28:33 +0100181}
182
183.button-abort {
Akron7636edf2025-11-04 12:44:53 +0100184 background-color: colors.$middle-orange !important;
185 color: colors.$darkest-orange !important;
186 border-color: colors.$darkest-orange !important;
Akron7e5afce2020-08-25 15:50:19 +0200187}
188
Akron9f2ad342022-05-04 16:16:40 +0200189button, input[type=submit] {
Akron7e5afce2020-08-25 15:50:19 +0200190 cursor: pointer;
191
192 + button {
193 right: 0;
194 }
195
196 &[type=submit] {
Akron7636edf2025-11-04 12:44:53 +0100197 @include choose.choose-item;
Akron7e5afce2020-08-25 15:50:19 +0200198 font-weight: normal;
199 padding: 0;
200 height: 100%;
201 top: 0;
Akron7636edf2025-11-04 12:44:53 +0100202 width: lengths.$button-width;
Akron7e5afce2020-08-25 15:50:19 +0200203
204 > span:nth-of-type(1) {
Akron7636edf2025-11-04 12:44:53 +0100205 @include mixins.blind;
Akron7e5afce2020-08-25 15:50:19 +0200206 }
207
208 &::after {
209 font-family: "FontAwesome";
210 }
211
Akron7e5afce2020-08-25 15:50:19 +0200212 &:hover,
213 &:focus {
Akron7636edf2025-11-04 12:44:53 +0100214 @include choose.choose-hover;
Akron7e5afce2020-08-25 15:50:19 +0200215 }
216
217 &::-moz-focus-inner {
218 border: none;
219 }
220
221 &:active {
Akron7636edf2025-11-04 12:44:53 +0100222 @include choose.choose-active;
Akron7e5afce2020-08-25 15:50:19 +0200223 }
224
225 /*
226 * This is just for styling the last button,
227 * in case there are more than one buttons.
228 */
229 &:last-of-type {
230 border: {
Akron7636edf2025-11-04 12:44:53 +0100231 right-width: lengths.$border-size;
Akron7e5afce2020-08-25 15:50:19 +0200232 right-style: solid;
Akron7636edf2025-11-04 12:44:53 +0100233 top-right-radius: lengths.$standard-border-radius;
234 bottom-right-radius: lengths.$standard-border-radius;
Akron7e5afce2020-08-25 15:50:19 +0200235 }
236 }
237 }
238}
239
Akron9f2ad342022-05-04 16:16:40 +0200240button[type=submit] {
Akron7636edf2025-11-04 12:44:53 +0100241 border: lengths.$border-size solid colors.$nearly-white;
Akron9f2ad342022-05-04 16:16:40 +0200242}
243
244*[type=submit].form-submit {
Akron7636edf2025-11-04 12:44:53 +0100245 box-shadow: choose.$choose-box-shadow;
246 border-radius: lengths.$standard-border-radius;
Akron9f2ad342022-05-04 16:16:40 +0200247 border-width: 2px !important;
Akron7636edf2025-11-04 12:44:53 +0100248 padding: lengths.$base-padding !important;
Akron9f2ad342022-05-04 16:16:40 +0200249}
250
Akron7e5afce2020-08-25 15:50:19 +0200251/**
252 * Checkbox styling
253 * http://stackoverflow.com/questions/4148499/how-to-style-checkbox-using-css
254 */
255.checkbox {
256 display: none;
257
258 + label {
259 cursor: pointer;
260
261 span {
262 display: inline-block;
263 border-radius: 4px;
264 width: 1em;
265 height: 1em;
266 line-height: 1em;
267 vertical-align: middle;
268 padding: 0;
269 margin-right: .2em;
270
271 &::after {
Akron7636edf2025-11-04 12:44:53 +0100272 @include mixins.icon-font;
273 content: icons.$fa-check;
Akron7e5afce2020-08-25 15:50:19 +0200274 }
275 }
276 }
277
278 &:checked + label span::after {
Akron7636edf2025-11-04 12:44:53 +0100279 content: icons.$fa-checked;
Akron7e5afce2020-08-25 15:50:19 +0200280 }
Akron1a9d5be2020-03-19 17:28:33 +0100281}