blob: 8275f54005f7a4372cc4fb7c86d64637efbf9d6d [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
Akron1a9d5be2020-03-19 17:28:33 +0100126 a.form-button:hover {
Akron548ee672020-10-19 17:41:20 +0200127 color: inherit !important;
Akron1a9d5be2020-03-19 17:28:33 +0100128 }
129
Akron59992122019-10-29 11:28:45 +0100130 label.field-required::after {
Akron7e5afce2020-08-25 15:50:19 +0200131 color: $ids-blue-1;
132 content: '*';
Akron59992122019-10-29 11:28:45 +0100133 }
Akron1a9d5be2020-03-19 17:28:33 +0100134}
135
136.button-abort {
137 background-color: $middle-orange !important;
Akron7e5afce2020-08-25 15:50:19 +0200138 color: $darkest-orange !important;
139 border-color: $darkest-orange !important;
140}
141
142button {
143 cursor: pointer;
144
145 + button {
146 right: 0;
147 }
148
149 &[type=submit] {
150 @include choose-item;
151 font-weight: normal;
152 padding: 0;
153 height: 100%;
154 top: 0;
155 width: $button-width;
156
157 > span:nth-of-type(1) {
158 @include blind;
159 }
160
161 &::after {
162 font-family: "FontAwesome";
163 }
164
165 border: $border-size solid $nearly-white;
166
167 &:hover,
168 &:focus {
169 @include choose-hover;
170 }
171
172 &::-moz-focus-inner {
173 border: none;
174 }
175
176 &:active {
177 @include choose-active;
178 }
179
180 /*
181 * This is just for styling the last button,
182 * in case there are more than one buttons.
183 */
184 &:last-of-type {
185 border: {
186 right-width: $border-size;
187 right-style: solid;
188 top-right-radius: $standard-border-radius;
189 bottom-right-radius: $standard-border-radius;
190 }
191 }
192 }
193}
194
195/**
196 * Checkbox styling
197 * http://stackoverflow.com/questions/4148499/how-to-style-checkbox-using-css
198 */
199.checkbox {
200 display: none;
201
202 + label {
203 cursor: pointer;
204
205 span {
206 display: inline-block;
207 border-radius: 4px;
208 width: 1em;
209 height: 1em;
210 line-height: 1em;
211 vertical-align: middle;
212 padding: 0;
213 margin-right: .2em;
214
215 &::after {
216 @include icon-font;
217 content: $fa-check;
218 }
219 }
220 }
221
222 &:checked + label span::after {
223 content: $fa-checked;
224 }
Akron1a9d5be2020-03-19 17:28:33 +0100225}