Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 1 | @import "lengths"; |
| 2 | @import "colors"; |
| 3 | |
| 4 | /** |
| 5 | * Definition of form elements for Kalamar. |
| 6 | */ |
Akron | 5999212 | 2019-10-29 11:28:45 +0100 | [diff] [blame] | 7 | |
| 8 | .form-table { |
| 9 | display: block; |
| 10 | padding: 0; |
Akron | 0be894f | 2020-09-21 12:20:08 +0200 | [diff] [blame] | 11 | font-size: 80%; |
Akron | 5999212 | 2019-10-29 11:28:45 +0100 | [diff] [blame] | 12 | |
Akron | 0be894f | 2020-09-21 12:20:08 +0200 | [diff] [blame] | 13 | > fieldset { |
| 14 | margin-top: 0; |
| 15 | } |
| 16 | |
Akron | 5999212 | 2019-10-29 11:28:45 +0100 | [diff] [blame] | 17 | fieldset { |
| 18 | border-width: 0; |
| 19 | padding: 0; |
Akron | 0be894f | 2020-09-21 12:20:08 +0200 | [diff] [blame] | 20 | margin-top: 1em; |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 21 | > div { |
| 22 | white-space: nowrap; |
| 23 | } |
Akron | 5999212 | 2019-10-29 11:28:45 +0100 | [diff] [blame] | 24 | } |
| 25 | |
| 26 | legend { |
| 27 | background-color: transparent; |
| 28 | margin-left: 0; |
| 29 | font-weight: bold; |
| 30 | border-radius: $standard-border-radius; |
| 31 | } |
| 32 | |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 33 | label, |
| 34 | input[type=radio] { |
Akron | 0be894f | 2020-09-21 12:20:08 +0200 | [diff] [blame] | 35 | // font-size: 80%; |
Akron | 5999212 | 2019-10-29 11:28:45 +0100 | [diff] [blame] | 36 | } |
| 37 | |
| 38 | label[for] { |
| 39 | display: block; |
| 40 | text-align: left; |
| 41 | } |
| 42 | |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 43 | label[for], |
| 44 | input[type=submit], |
| 45 | a.form-button { |
Akron | 5999212 | 2019-10-29 11:28:45 +0100 | [diff] [blame] | 46 | margin-top: 2em; |
| 47 | } |
| 48 | |
Akron | 0be894f | 2020-09-21 12:20:08 +0200 | [diff] [blame] | 49 | 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 | |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 71 | input, |
| 72 | textarea, |
| 73 | button, |
| 74 | a.form-button { |
Akron | 5999212 | 2019-10-29 11:28:45 +0100 | [diff] [blame] | 75 | border-radius: $standard-border-radius; |
| 76 | } |
| 77 | |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 78 | input, |
| 79 | textarea { |
| 80 | border-color: $ids-grey-2; |
Akron | 5999212 | 2019-10-29 11:28:45 +0100 | [diff] [blame] | 81 | background-color: $nearly-white; |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 82 | border-style: solid; |
Akron | 5999212 | 2019-10-29 11:28:45 +0100 | [diff] [blame] | 83 | } |
| 84 | |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 85 | input, |
| 86 | textarea, |
| 87 | select, |
| 88 | a.form-button { |
Akron | 1a9d5be | 2020-03-19 17:28:33 +0100 | [diff] [blame] | 89 | border-style: solid; |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 90 | display: inline-block; |
| 91 | width: 20%; |
| 92 | min-width: 20em; |
| 93 | padding: $base-padding; |
Akron | 5999212 | 2019-10-29 11:28:45 +0100 | [diff] [blame] | 94 | } |
| 95 | |
| 96 | input[type=radio] { |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 97 | display: inline; |
Akron | 548ee67 | 2020-10-19 17:41:20 +0200 | [diff] [blame] | 98 | text-align: right; |
Akron | 5999212 | 2019-10-29 11:28:45 +0100 | [diff] [blame] | 99 | background-color: red; |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 100 | width: auto; |
| 101 | min-width: auto; |
Akron | 5999212 | 2019-10-29 11:28:45 +0100 | [diff] [blame] | 102 | } |
| 103 | |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 104 | input[readonly=readonly], |
| 105 | textarea[readonly] { |
| 106 | background-color: $light-orange; |
Akron | 5999212 | 2019-10-29 11:28:45 +0100 | [diff] [blame] | 107 | } |
| 108 | |
| 109 | .field-with-error { |
| 110 | border-color: $ids-pink-1; |
| 111 | } |
| 112 | |
Akron | 1a9d5be | 2020-03-19 17:28:33 +0100 | [diff] [blame] | 113 | input[type=submit], |
| 114 | button, |
| 115 | a.form-button { |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 116 | display: inline-block; |
| 117 | cursor: pointer; |
| 118 | border-width: thin; |
| 119 | text-align: center; |
Akron | 1a9d5be | 2020-03-19 17:28:33 +0100 | [diff] [blame] | 120 | background-color: $middle-green; |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 121 | border-color: $dark-green; |
Akron | 0be894f | 2020-09-21 12:20:08 +0200 | [diff] [blame] | 122 | // font-size: 8pt; |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 123 | color: $dark-green; |
Akron | 5999212 | 2019-10-29 11:28:45 +0100 | [diff] [blame] | 124 | } |
| 125 | |
Akron | 9f2ad34 | 2022-05-04 16:16:40 +0200 | [diff] [blame] | 126 | 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 | |
Akron | 1a9d5be | 2020-03-19 17:28:33 +0100 | [diff] [blame] | 165 | a.form-button:hover { |
Akron | 548ee67 | 2020-10-19 17:41:20 +0200 | [diff] [blame] | 166 | color: inherit !important; |
Akron | 1a9d5be | 2020-03-19 17:28:33 +0100 | [diff] [blame] | 167 | } |
| 168 | |
Akron | 5999212 | 2019-10-29 11:28:45 +0100 | [diff] [blame] | 169 | label.field-required::after { |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 170 | color: $ids-blue-1; |
| 171 | content: '*'; |
Akron | 5999212 | 2019-10-29 11:28:45 +0100 | [diff] [blame] | 172 | } |
Akron | 1a9d5be | 2020-03-19 17:28:33 +0100 | [diff] [blame] | 173 | } |
| 174 | |
| 175 | .button-abort { |
| 176 | background-color: $middle-orange !important; |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 177 | color: $darkest-orange !important; |
| 178 | border-color: $darkest-orange !important; |
| 179 | } |
| 180 | |
Akron | 9f2ad34 | 2022-05-04 16:16:40 +0200 | [diff] [blame] | 181 | button, input[type=submit] { |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 182 | 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 | |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 204 | &: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 | |
Akron | 9f2ad34 | 2022-05-04 16:16:40 +0200 | [diff] [blame] | 232 | button[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 | |
Akron | 7e5afce | 2020-08-25 15:50:19 +0200 | [diff] [blame] | 243 | /** |
| 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 | } |
Akron | 1a9d5be | 2020-03-19 17:28:33 +0100 | [diff] [blame] | 273 | } |