/* ====================================================================================================================
Forms
Individual form controls receive default styling with `form` Results in stacked, left-aligned labels on top of form controls.
.form
+–– .form__group
| |–– .form__label
| +–– .form__controls
| |–– input
| |–– textarea
| |–– .form__select
| |–– .form__checkbox
| |–– .form__radio
| +–– .form__addon
+–– .form__actions
* **`.form__group`**: Main container of a section of the form
* **`.form__label`**: Main labels for the form.
* **`.form__controls`**: Container of inputs, buttons and addons
* **`.form__checkbox`**, **`.form__radio`**: Stacked list of checkboxes and radios.
* **`.form__checkbox.inline`**, **`.form__radio.inline`**: Inline list of checkboxes and radios.
* **`.form__select`**: Create custom style selects.
* **`.form__help--block`**: Block help text that appears under form controls.
* **`.form__help--inline`**: Inline help text that appears aside form controls.
* **`.form__actions`**: End a form with a group of actions (buttons). When placed within a `.form__actions`, the buttons will automatically indent to line up with the form controls.
Styleguide 8
==================================================================================================================== */
@if $forms {
form {
@extend .clearfix;
margin: 0 0 rhythm();
}
fieldset {
padding: 0;
margin: 0;
border: 0;
}
legend {
@include adjust-font-size-to($h5-size);
display: block;
padding: 0;
width: 100%;
font-weight: bold;
border: 0;
padding-bottom: rhythm(.5);
margin-bottom: rhythm(.5);
border-bottom: 1px solid #e5e5e5;
small {
font-size: em($base-font-size);
color: $grayLight;
}
}
label,
input,
button,
select,
textarea {
line-height: 1em;
font-family: $base-font-family;
@include border-radius($base-border-radius);
}
.input-text,
textarea,
input[type="text"],
input[type="password"],
input[type="datetime"],
input[type="datetime-local"],
input[type="date"],
input[type="month"],
input[type="time"],
input[type="week"],
input[type="number"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="tel"],
input[type="color"] {
display: inline-block;
padding: 0 $input-padding-side;
vertical-align: middle;
height: $input-height;
border-width: $input-border;
border-style: solid;
@media \0screen { line-height: $input-height; } // Ugly IE8 Hack
@extend %input !optional;
&:focus {outline: 0;}
}
select {
color: $text-color;
display: inline-block;
}
label { display: block; }
input,
textarea {
width: 240px;
}
textarea {
height: auto;
line-height: rhythm(1);
padding: $input-padding;
}
input[type="radio"],
input[type="checkbox"] {
margin: em(1px) 0 0;
}
input[type="file"],
input[type="image"],
input[type="submit"],
input[type="reset"],
input[type="button"],
input[type="radio"],
input[type="checkbox"] {
width: auto;
}
select,
.form__select {
width: 240px;
}
select[multiple],
select[size] {
height: auto;
}
input,
textarea {
@include placeholder($placeholder-color);
}
// input[disabled],
// select[disabled],
// textarea[disabled],
// input[readonly],
// select[readonly],
// textarea[readonly] {
// cursor: not-allowed;
// }
input[type="radio"][disabled],
input[type="checkbox"][disabled],
input[type="radio"][readonly],
input[type="checkbox"][readonly] {
background-color: transparent;
}
input:focus:invalid,
textarea:focus:invalid,
select:focus:invalid {
color: #b94a48;
border-color: #ee5f5b;
&:focus {
border-color: darken(#ee5f5b, 10%);
}
}
// }
.form__group + .form__group { margin-top: em($control-margin-bottom); }
.form__controls { @extend .clearfix; }
/* --------------------------------------------------------------------------------------------------------------------
Labels
Main labels for the form using `.form__label`
Markup:
Styleguide 8.1
-------------------------------------------------------------------------------------------------------------------- */
.form__label {
font-weight: bold;
margin-bottom: em($label-margin-bottom);
cursor: auto;
}
/* --------------------------------------------------------------------------------------------------------------------
Radio & Checkbox
Markup:
.inline - Inline alignment with `.inline`
Styleguide 8.2
-------------------------------------------------------------------------------------------------------------------- */
.form__radio,
.form__checkbox,
.form__select {
min-height: em($base-line-height);
padding-left: em($checkbox-padding-left);
font-weight: normal;
cursor: pointer;
display: block;
}
.form__select {padding-left: 0;}
.form__radio input[type="radio"],
.form__checkbox input[type="checkbox"] {
float: left;
margin-left: -20px;
}
.form__radio.inline,
.form__checkbox.inline {
display: inline-block;
vertical-align: middle;
}
.form__radio.inline + .form__radio.inline,
.form__checkbox.inline + .form__checkbox.inline {
margin-left: 20px;
}
/* --------------------------------------------------------------------------------------------------------------------
Custom Select
Add custom styling to a select element wrapping the `