_form-group.scss 7.86 KB
Newer Older
Naomi Guyer's avatar
Naomi Guyer committed
1
// remove styles on outer element as class is duplicated to form element
Liam Sharpe's avatar
Liam Sharpe committed
2
.form-group.btn:not(.checkbox),
Naomi Guyer's avatar
Naomi Guyer committed
3
4
5
6
7
8
9
10
11
12
.form-group-inline.btn {
    background: none;
    border: none;
    padding-left: 0;
    &:hover {
        background: none;
        border: none;
    }
}

Naomi Guyer's avatar
Naomi Guyer committed
13
.form-group {
Naomi Guyer's avatar
Naomi Guyer committed
14
15
16
17
18
    border-bottom: 1px solid #f0f0f0;
    margin: 0;
    padding: 20px 0;
    position: relative;

Naomi Guyer's avatar
Naomi Guyer committed
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
    &.fake-form {
        border: 0;
        padding: 0;
        .collapsible-group .panel.collapsible & {
            border: 0;
            padding: 0;
        }
    }

    // this is a weird and somewhat broken case where form renderers are being use to render regular html
    &.html form {
        display: block;
        .form-group,
        .collapsible-group .panel.collapsible & .form-group {
            border: 0;
            padding: 0;
        }
    }

Naomi Guyer's avatar
Naomi Guyer committed
38
39
40
41
    &.button,
    &.submit {
        background: transparent;
        padding: 0;
Naomi Guyer's avatar
Naomi Guyer committed
42
        padding-top: $grid-gutter-width;
Naomi Guyer's avatar
Naomi Guyer committed
43
        border: 0;
Naomi Guyer's avatar
Naomi Guyer committed
44
45
46
        .form-inline & {
            padding: 0;
        }
Naomi Guyer's avatar
Naomi Guyer committed
47
    }
Naomi Guyer's avatar
Naomi Guyer committed
48

Naomi Guyer's avatar
Naomi Guyer committed
49
    //used when adding email addresses to profiles (anywhere else?)
Naomi Guyer's avatar
Naomi Guyer committed
50
51
52
53
54
55
56
57
58
    .message {
        font-size: 0.9em;
        color: $gray;
    }

    .form-inline & {
        padding: 0;
    }

59
60
    .modal-body & {
        padding: 10px 0;
Naomi Guyer's avatar
Naomi Guyer committed
61

62
63
64
65
66
        .description:not(.html) {
            padding-top: 5px;
        }
    }

Naomi Guyer's avatar
Naomi Guyer committed
67
68
    &.hide-label,
    .hide-label & {
69
        label {
Naomi Guyer's avatar
Naomi Guyer committed
70
            @include sr-only;
71
72
73
74
75
76
        }
    }

    &.last {
        border:0;
    }
Naomi Guyer's avatar
Naomi Guyer committed
77
78
79
80
81
82
83
84
85
86
87

    &.login {
        input {
            &[type=text],
            &[type=password] {
                max-width:100%;
            }
        }
    }

    &.input-small,
88
    &.input-group,
Naomi Guyer's avatar
Naomi Guyer committed
89
90
91
92
    &:last-child {
        border: 0;
    }

93
    &.tab-pane,
Naomi Guyer's avatar
Naomi Guyer committed
94
95
96
97
98
    &.collapsible-group {
        border: 0;
        padding: 0;
    }

99
100
101
102
103
104
105
106
    &.checkboxes {
        .btn-group {
            margin: 10px 0;
            display: block;
        }
         input[type=checkbox] {
            margin-left: 0;
        }
Naomi Guyer's avatar
Naomi Guyer committed
107
108
109
110
111
        &.stacked {
            .checkboxes-option {
                margin-left: 0;
            }
        }
112
113
114
115
116
117
        .checkboxes-option {
            margin-left: 265px;
            display: inline-block;
        }
    }

Naomi Guyer's avatar
Naomi Guyer committed
118
119
120
121
122
123
    &.checkbox {
        label {
            padding-left: 0;
        }
        .checkbox {
            display: inline-block;
Liam Sharpe's avatar
Liam Sharpe committed
124
            position: relative;
Naomi Guyer's avatar
Naomi Guyer committed
125
126
127
128
129
130
131
132
133
134
135
136
137
        }
        input[type=checkbox] {
            margin-left: 0;
        }
    }

    &.calendar {
        .calendar {
            margin-left: 0;
            width: 165px;
        }
    }

138
139
140
141
    &.submit {
        border-bottom: none;
    }

Naomi Guyer's avatar
Naomi Guyer committed
142
143
    // reset bootstrap button style for cancel button
    &.submitcancel {
144
        border-bottom: none;
Naomi Guyer's avatar
Naomi Guyer committed
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
        .cancel {
            background-color: transparent;
            border: none;
            text-decoration: underline;
            color: $link-color;
            &:hover {
                color: $link-hover-color;
            }
        }
    }

    &.filebrowser {
        label {
            vertical-align: top;
        }
    }

     &.checkbox {
         .description {
            margin-left:0;
            max-width: 700px;
         }
    }

     &.tags {
        .tag-wrapper {
            display: block;
            @media (min-width: $screen-sm-min) {
                display: inline-block;
            }
            input {
                max-width: 85%;
                display: inline-block;
                @media (min-width: $screen-sm-min) {
                    max-width: 100%;
                }
            }
        }
    }
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205

    &.color {
        label {
            &:first-child {
                display: block;
                @media (min-width: $screen-sm-min) {
                    display: inline-block;
                }
            }
            &:not(:first-child) {
                min-width: inherit;
            }
        }
        input {
            &.color {
                max-width: 240px;
            }
        }
    }
    &.html {
        border-bottom: none;
    }
Naomi Guyer's avatar
Naomi Guyer committed
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
    &.double {
        .description {
            margin-left: 0;
            max-width:90%;
        }
        input[type=text],
        input[type=password],
        select {
            max-width: 45%;
            display: inline-block;
            @media (min-width: $screen-sm-min) {
                width: 150px;
            }
            @media (min-width: $screen-lg-min) {
                width: 150px;
            }
        }
    }

225
226
227
228
229
230
231
232
233
234
    // c.f edit group
   &.five-across {
        label {
            clear:both;
            width:100%;
        }
        input[type=text],
        input[type=password],
        select {
            @media (min-width: $screen-sm-min) {
235
                width: 155px;
236
237
238
239
240
241
242
243
244
245
246
            }
            @media (min-width: $screen-lg-min) {
                width: 150px;
            }
        }
        select {
            margin-left: 5px;
        }
        label + select {
            margin-left: 0px; // padding provided by label instead
        }
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
        &.multi-label {
            &.customrow {
                padding: 5px 0;
            }

             > .field {
                width: 167px;

                &.field-selectnumcols {
                    width: 123px;
                }

                .selectnumcols {
                    width: 107px;
                }

                select {
                    max-width: 90%;
                }

                label {
                    font-size: 0.8em;
                    color: #888;
                }
                &.customrowtitle {
                    width: 70px;
                    margin-top:30px;
                }
            }
276
277
278
279
        }
    }

    h4,
Naomi Guyer's avatar
Naomi Guyer committed
280
    h3 {
281
282
283
284
        padding-bottom: 5px;
        margin-bottom: 20px;
    }
      h3 {
Naomi Guyer's avatar
Naomi Guyer committed
285
286
        font-size: $font-size-large;
        padding-bottom: 10px;
287
288
    }

Naomi Guyer's avatar
Naomi Guyer committed
289
290
291
292
293
294
295
296
297
298
299
300

    .file-wrapper,
    .tag-wrapper input,
    .about-text,
    input[type=text],
    input[type=password],
    input[type=file],
    textarea,
    select {
        display: inline-block;
        @media (min-width: $screen-sm-min) {
            width: 420px;
301
302
303
            max-width: 85%;
            .columns3 &,
            .columns3 &,
Naomi Guyer's avatar
Naomi Guyer committed
304
305
            .columns3 &,
            .form-inline & {
306
307
                max-width:100%;
            }
Naomi Guyer's avatar
Naomi Guyer committed
308
309
310
            .form-inline & {
                width: 100%;
            }
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
        }
        @media (min-width: $screen-lg-min) {
            width: 500px;
        }
    }

    .mce-tinymce {
        @media (min-width: $screen-sm-min) {
            width: 420px;
            max-width: 100%;
            .columns3 &,
            .columns3 &,
            .columns3 & {
                max-width: 100%;
            }
Naomi Guyer's avatar
Naomi Guyer committed
326
327
328
329
330
331
332
333
334
335
336
        }
        @media (min-width: $screen-lg-min) {
            width: 500px;
        }
    }

    .pseudolabel ~ .radio:not(.form-group){
        &:nth-child(n+3) {
            @extend .align-with-input;
        }
    }
337

Naomi Guyer's avatar
Naomi Guyer committed
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
    .form-group.radio,
    .radio {
        @media (min-width: $screen-sm-min) {
            margin-top: 0;
            display: inline-block;
        }
        input[type=radio] {
            margin-top: 5px;
            margin-left: 0;
        }
    }

    .help {
        position: absolute;
        right: 0;
        top: 50%;
        margin-top:-20px;
    }

    .errmsg {
        @extend .align-with-input;
        color: $brand-danger;
        font-size: $font-size-base - 1;
        display: block;
        padding-top: 10px;
363

Naomi Guyer's avatar
Naomi Guyer committed
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
        @media (min-width: $screen-md-min) {
            margin-left: 230px;
        }
    }

    .description:not(.html) {
        color: $gray-light;
        font-style: italic;
        font-size: $font-size-base - 1;
        max-width: 90%;
        display: block;
        padding-top: 10px;
    }
    .requiredmarker {
        color: $brand-danger;
    }

    @media (min-width: $screen-sm-min) {
        &.input-small {
            max-width: 100%;
            width: 25%;
            .input-small {
                margin:0;
            }
        }
    }
}