// Forms // ========================================================================== // Form group is used to wrap label and input pairs .form-group { float: left; width: 100%; clear: both; @include contain-floats; margin-bottom: $gutter-half; @include media(tablet) { margin-bottom: $gutter; } } .form-group-related { margin-bottom: 10px; @include media(tablet) { margin-bottom: 20px; } } .form-group-compound { margin-bottom: 10px; } // Fieldset is used to group more than one .form-group fieldset { width: 100%; clear: both; } // Form title .form-title { margin-bottom: $gutter; @include media(tablet) { margin-bottom: ($gutter*1.5); } } // Labels // Form labels, or for legends styled to look like labels .form-label { @include core-19; display: block; margin-bottom: 5px; } .form-label-bold { @include bold-24; display: block; margin-bottom: 0; .form-hint { @include core-19; } } // Used for paragraphs in-between form elements .form-block { float: left; width: 100%; @include contain-floats; } // Hints // Form hints & examples are light grey and sit above a form control .form-hint { display: block; color: $secondary-text-colour; margin-bottom: 5px; @include media (tablet) { margin-top: 8px; } } // Form controls // By default, form controls are 50% width for desktop, // and 100% width for mobile .form-control { @include core-19; width: 100%; @include box-sizing(border-box); padding: 4px; background-color: $white; border: 1px solid $border-colour; // Disable webkit appearance and remove rounded corners -webkit-appearance: none; border-radius: 0; @include media(tablet) { width: 50%; } } // Form control widths .form-control-3-4 { width: 100%; @include media(tablet) { width: 75%; } } .form-control-1-2 { width: 100%; @include media(tablet) { width: 50%; } } .form-control-1-4 { width: 25%; } .form-control-1-8 { width: 12.5%; } // Radio buttons .form-radio { display: block; margin: 10px 0; } .form-radio input { vertical-align: middle; margin: -4px 5px 0 0; } // Checkboxes .form-checkbox { display: block; margin: $gutter-half 0; margin-bottom: 30px; } .form-checkbox input { vertical-align: middle; margin: -2px 5px 0 0; width: 30px; -webkit-appearance: checkbox; } .form-checkbox label { display: inline; font-weight: normal; cursor: pointer; font-size: 19px; } // Buttons .form .button { @include media(mobile) { width: 100%; } } // Hide toggled content .js-enabled .toggle-content { display: none; } // Form validation @import "forms/form-validation"; // Form patterns @import "forms/form-date-of-birth"; @import "forms/form-chunky-labels";