Files
Adam Bradley 8ba2411eb0 form row fixes
2013-09-10 11:00:28 -05:00

259 lines
5.2 KiB
SCSS

// Forms
// -------------------------------
// Make all forms have space below them
form {
margin: 0 0 $line-height-base;
}
fieldset {
padding: 0;
margin: 0;
border: 0;
}
// Groups of fields with labels on top (legends)
legend {
display: block;
width: 100%;
padding: 0;
margin-bottom: $line-height-base;
font-size: $font-size-base * 1.5;
line-height: $line-height-base * 2;
color: $gray-dark;
border: 0;
border-bottom: 1px solid #e5e5e5;
// Small
small {
font-size: $line-height-base * .75;
color: $gray-light;
}
}
// Set font for forms
label,
input,
button,
select,
textarea {
@include font-shorthand($font-size-base, normal, $line-height-base); // Set size, weight, line-height here
}
input,
button,
select,
textarea {
font-family: $base-font-family; // And only set font-family here for those that need it (note the missing label element)
}
.form-group {
border-top: $input-border-width solid $input-border-color;
border-bottom: $input-border-width solid $input-border-color;
background-color: $input-bg;
overflow: hidden;
}
.content-padded > .form-group,
.form-group.inset {
border-left: $input-border-width solid $input-border-color;
border-right: $input-border-width solid $input-border-color;
@include border-radius($input-border-radius);
}
.form-group .input-wrapper + .input-wrapper {
border-top: $input-border-width solid $input-border-color;
}
.form-group + .form-group {
margin-top: $content-padding;
}
.input-wrapper {
display: block;
padding: 6px 8px 5px;
overflow: hidden;
input {
background-color: transparent;
margin: 0;
-webkit-appearance: none;
@include border-radius(0);
}
.input-label {
font-weight: bold;
line-height: $line-height-computed + $font-size-base;
}
}
.form-group.stacked-label,
.form-group.stacked-label .input-wrapper {
background-color: transparent;
border: 0;
}
.form-group.stacked-label input {
border: $input-border-width solid $input-border-color;
background-color: $input-bg;
padding: 4px 8px 3px;
overflow: hidden;
@include border-radius($input-border-radius);
}
.input-wrapper.row {
margin-left: 0;
margin-right: 0;
[class*='col-'] {
padding-left: 0;
padding-right: 0;
}
}
// Form Controls
// -------------------------------
// Shared size and type resets
select,
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"],
.uneditable-input {
display: inline-block;
height: $line-height-computed + $font-size-base;
font-size: $font-size-base;
line-height: $line-height-computed;
color: $gray;
vertical-align: middle;
}
input,
textarea,
.uneditable-input {
width: 100%;
}
// Reset height since textareas have rows
textarea {
height: auto;
}
// Everything else
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"],
.uneditable-input {
border: 0;
// Focus state
&:focus {
outline: 0;
outline: thin dotted \9; /* IE6-9 */
}
}
// Position radios and checkboxes better
input[type="radio"],
input[type="checkbox"] {
margin: 4px 0 0;
margin-top: 1px \9; /* IE8-9 */
line-height: normal;
}
// Reset width of input images, buttons, radios, checkboxes
input[type="file"],
input[type="image"],
input[type="submit"],
input[type="reset"],
input[type="button"],
input[type="radio"],
input[type="checkbox"] {
width: auto; // Override of generic input selector
}
// Set the height of select and file controls to match text inputs
select,
input[type="file"] {
height: $input-height-base; /* In IE7, the height of the select element cannot be changed by height, only font-size */
line-height: $input-height-base;
}
// Make select elements obey height by applying a border
select {
width: 220px; // default input width + 10px of padding that doesn't get applied
border: $input-border-width solid $input-border-color;
background-color: $input-bg; // Chrome on Linux and Mobile Safari need background-color
}
// Make multiple select elements height not fixed
select[multiple],
select[size] {
height: auto;
}
// Focus for select, file, radio, and checkbox
select:focus,
input[type="file"]:focus,
input[type="radio"]:focus,
input[type="checkbox"]:focus {
@include tab-focus();
}
// Placeholder
// -------------------------------
input,
textarea {
@include placeholder();
}
// DISABLED STATE
// -------------------------------
// Disabled and read-only inputs
input[disabled],
select[disabled],
textarea[disabled],
input[readonly],
select[readonly],
textarea[readonly] {
cursor: not-allowed;
background-color: $input-bg-disabled;
}
// Explicitly reset the colors here
input[type="radio"][disabled],
input[type="checkbox"][disabled],
input[type="radio"][readonly],
input[type="checkbox"][readonly] {
background-color: transparent;
}