Build mobile apps with simple HTML, CSS, and JS components. http://goratchet.com/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

142 lines
3.1 KiB

//
// Forms
// --------------------------------------------------
// Force form elements to inherit font styles
input,
textarea,
button,
select {
font-family: $font-family-default;
font-size: $font-size-default;
}
// Stretch inputs/textareas to full width and add height to maintain a consistent baseline
select,
textarea,
input[type="text"],
input[type=search],
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="tel"],
input[type="color"],
.input-group {
width: 100%;
height: 40px;
padding: 10px 15px;
margin-bottom: 10px;
line-height: $line-height-default;
background-color: #fff;
border: 1px solid rgba(0, 0, 0, .2);
border-radius: 3px;
outline: none;
-webkit-appearance: none;
}
// Fully round search input
input[type=search] {
height: 34px;
padding: 0 10px;
font-size: 16px;
text-align: center;
border-radius: 6px;
border-width: 0;
background-color: rgba(0,0,0,.1);
box-sizing: border-box; // Override content-box in normalize
}
input[type=search]:focus {
text-align: left;
}
// Allow text area's height to grow larger than a normal input
textarea {
height: auto;
}
// Style select button to look like part of the Ratchet's style
select {
height: auto;
font-size: 14px;
background-color: #f8f8f8;
@include box-shadow(inset 0 1px 1px rgba(0, 0, 0, .1));
}
// Input groups (cluster multiple inputs together into a single group)
// -------------------------------------------------------------------
// Reset from initial form setup styles
.input-group {
width: auto;
height: auto;
padding: 0;
border-left: 0;
border-right: 0;
border-radius: 0;
}
// Remove spacing, borders, shadows and rounding since it all belongs on the .input-group not the input
.input-group input {
margin-bottom: 0;
background-color: transparent;
border: 0;
border-radius: 0;
@include box-shadow(none);
@include hairline(single, #c8c7cc, 320px, 15px);
}
// Remove bottom border on last input to avoid double bottom border
.input-group input:last-child {
background-image: none;
}
// Input groups with labels
// --------------------------------------------------
// To use labels with input groups, wrap a label and an input in an .input-row
.input-row {
overflow: hidden;
@include hairline(single, #c8c7cc, 320px, 15px);
}
// Remove bottom border on last input-row to avoid double bottom border
.input-row:last-child {
background-image: none;
}
// Labels get floated left with a set percentage width
.input-row label {
float: left;
width: 35%;
padding: 10px 15px;
font-family: $font-family-default;
line-height: 1.1; // Put the text on the baseline.
}
// Actual inputs float to right of labels and also have a set percentage
.input-row label + input {
float: right;
width: 65%;
padding-left: 0;
margin-bottom: 0;
background-image: none;
}
// Search forms in standard bar
// --------------------------------------------------
// Position/size search bar within the bar
[class*="bar-"] input[type=search] {
height: 29px;
margin: 2px 0;
}