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.

122 lines
2.8 KiB

12 years ago
/* Forms
-------------------------------------------------- */
// Force form elements to inherit font styles
12 years ago
input,
textarea,
button,
select {
font-family: inherit;
font-size: inherit;
}
// Stretch inputs/textareas to full width and add height to maintain a consistent baseline
12 years ago
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;
margin-bottom: 10px;
12 years ago
background-color: #fff;
12 years ago
border: 1px solid rgba(0, 0, 0, .2);
border-radius: 3px;
-webkit-appearance: none;
box-sizing: border-box;
outline: none;
12 years ago
}
// Fully round search input
12 years ago
input[type=search] {
height: 34px;
font-size: 14px;
border-radius: 6px;
border-width: 0;
11 years ago
background-color: rgba(0,0,0,.1);
12 years ago
}
// Allow text area's height to grow larger than a normal input
12 years ago
textarea {
height: auto;
}
// Style select button to look like part of the Ratchet's style
12 years ago
select {
height: auto;
font-size: 14px;
background-color: #f8f8f8;
background-image: -webkit-linear-gradient(top, #f8f8f8 0%, #d4d4d4 100%);
background-image: linear-gradient(to bottom, #f8f8f8 0%, #d4d4d4 100%);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .1);
}
/* Input groups (cluster multiple inputs together into a single group)
---------------------------------------------------------------------- */
12 years ago
// Reset from initial form setup styles
12 years ago
.input-group {
width: auto;
height: auto;
padding: 0;
}
// Remove spacing, borders, shadows and rounding since it all belongs on the .input-group not the input
12 years ago
.input-group input {
margin-bottom: 0;
background-color: transparent;
border: 0;
border-bottom: 1px solid rgba(0, 0, 0, .2);
border-radius: 0;
box-shadow: none;
}
// Remove bottom border on last input to avoid double bottom border
12 years ago
.input-group input:last-child {
border-bottom-width: 0;
}
/* Input groups with labels
-------------------------------------------------- */
// To use labels with input groups, wrap a label and an input in an .input-row
12 years ago
.input-row {
overflow: hidden;
border-bottom: 1px solid rgba(0, 0, 0, .2);
}
// Remove bottom border on last input-row to avoid double bottom border
12 years ago
.input-row:last-child {
border-bottom-width: 0;
}
// Labels get floated left with a set percentage width
12 years ago
.input-row label {
float: left;
width: 25%;
padding: 11px 10px 9px 13px; // Optimizing the baseline for mobile.
12 years ago
font-weight: bold;
}
// Actual inputs float to right of labels and also have a set percentage
12 years ago
.input-row label + input {
float: right;
width: 65%;
padding-left: 0;
margin-bottom: 0;
border-bottom: 0;
}