2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-20 20:00:36 +03:00

improve code quality on custom forms

This commit is contained in:
Mark Otto
2014-12-25 15:40:24 -08:00
parent dacac2ab72
commit b92534c632
9 changed files with 277 additions and 415 deletions
+19 -80
View File
@@ -1887,7 +1887,6 @@ legend {
label { label {
display: inline-block; display: inline-block;
margin-bottom: 5px; margin-bottom: 5px;
font-weight: bold;
} }
input[type="search"] { input[type="search"] {
@@ -3019,7 +3018,6 @@ input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="butto
position: relative; position: relative;
display: inline; display: inline;
padding-left: 1.5rem; padding-left: 1.5rem;
font-weight: normal;
color: #555; color: #555;
cursor: pointer; cursor: pointer;
} }
@@ -3027,7 +3025,6 @@ input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="butto
position: absolute; position: absolute;
z-index: -1; z-index: -1;
opacity: 0; opacity: 0;
/* Put the input behind the label so it doesn't overlay text */
} }
.c-input > input:focus ~ .c-indicator { .c-input > input:focus ~ .c-indicator {
-webkit-box-shadow: 0 0 0 .075rem #fff, 0 0 0 .2rem #0074d9; -webkit-box-shadow: 0 0 0 .075rem #fff, 0 0 0 .2rem #0074d9;
@@ -3059,7 +3056,7 @@ input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="butto
-webkit-user-select: none; -webkit-user-select: none;
-moz-user-select: none; -moz-user-select: none;
-ms-user-select: none; -ms-user-select: none;
user-select: none; user-select: none;
background-color: #eee; background-color: #eee;
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center center; background-position: center center;
@@ -3081,7 +3078,6 @@ input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="butto
background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNy4xLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2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qm94PSIwIDAgOCA4IiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA4IDgiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPHBhdGggZmlsbD0iI0ZGRkZGRiIgZD0iTTQsMUMyLjMsMSwxLDIuMywxLDRzMS4zLDMsMywzczMtMS4zLDMtM1M1LjcsMSw0LDF6Ii8+DQo8L3N2Zz4NCg==);
} }
/* Alternately, use another character */
.control-x input:checked ~ .control-indicator { .control-x input:checked ~ .control-indicator {
background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNy4xLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB3aWR0aD0iOHB4IiBoZWlnaHQ9IjhweCIgdmlld0JveD0iMCAwIDggOCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgOCA4IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxwYXRoIGZpbGw9IiNGRkZGRkYiIGQ9Ik0xLjQsMEwwLDEuNGwwLjcsMC43bDEuOCwxLjhMMC43LDUuN0wwLDYuNGwxLjQsMS40bDAuNy0wLjdsMS44LTEuOGwxLjgsMS44bDAuNywwLjdsMS40LTEuNEw3Lj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091,19 @@ input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="butto
} }
.c-inputs-stacked .c-input:after { .c-inputs-stacked .c-input:after {
display: block; display: block;
margin-bottom: .25rem; margin-bottom: .25rem;
content: ""; content: "";
} }
.c-inputs-stacked .c-input + .c-input { .c-inputs-stacked .c-input + .c-input {
margin-left: 0; margin-left: 0;
} }
/*
* Select
*/
.select { .select {
position: relative; position: relative;
display: inline-block; display: inline-block;
color: #555; color: #555;
} }
.select > select {
.select select {
display: inline-block; display: inline-block;
width: 100%; width: 100%;
-webkit-appearance: none; -webkit-appearance: none;
@@ -3125,17 +3117,23 @@ input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="butto
border-radius: .25rem; border-radius: .25rem;
outline: 0; outline: 0;
-moz-appearance: none;
appearance: none; appearance: none;
} }
.select > select:focus {
/* Undo the Firefox inner focus ring */ -webkit-box-shadow: 0 0 0 .075rem #fff, 0 0 0 .2rem #0074d9;
.select select:focus:-moz-focusring { box-shadow: 0 0 0 .075rem #fff, 0 0 0 .2rem #0074d9;
}
.select > select:focus:-moz-focusring {
color: transparent; color: transparent;
text-shadow: 0 0 0 #000; text-shadow: 0 0 0 #000;
} }
.select > select:active {
/* Dropdown arrow */ color: #fff;
background-color: #0074d9;
}
.select > select::-ms-expand {
display: none;
}
.select:after { .select:after {
position: absolute; position: absolute;
top: 50%; top: 50%;
@@ -3152,37 +3150,11 @@ input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="butto
border-left: .35rem solid transparent; border-left: .35rem solid transparent;
} }
/* Hover state */
/* Uncomment if you need it, but be aware of the sticky iOS states.
.select select:hover {
background-color: #ddd;
}
*/
/* Focus */
.select select:focus {
-webkit-box-shadow: 0 0 0 .075rem #fff, 0 0 0 .2rem #0074d9;
box-shadow: 0 0 0 .075rem #fff, 0 0 0 .2rem #0074d9;
}
/* Active/open */
.select select:active {
color: #fff;
background-color: #0074d9;
}
/* Hide the arrow in IE10 and up */
.select select::-ms-expand {
display: none;
}
/* Media query to target Firefox only */
@-moz-document url-prefix() { @-moz-document url-prefix() {
/* Firefox hack to hide the arrow */
/* <option> elements inherit styles from <select>, so reset them. */
.select select { .select select {
padding-right: 1rem; padding-right: 1rem;
text-indent: .01px; text-indent: .01px;
text-overflow: ''; text-overflow: "";
} }
.select option { .select option {
@@ -3190,7 +3162,6 @@ input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="butto
} }
} }
/* IE9 hack to hide the arrow */
@media screen and (min-width: 0\0) { @media screen and (min-width: 0\0) {
.select select { .select select {
z-index: 1; z-index: 1;
@@ -3219,13 +3190,10 @@ input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="butto
} }
} }
/*
* File
*/
.file { .file {
position: relative; position: relative;
display: inline-block; display: inline-block;
height: 2.5rem; height: 2.5rem;
cursor: pointer; cursor: pointer;
} }
@@ -3249,7 +3217,7 @@ input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="butto
-webkit-user-select: none; -webkit-user-select: none;
-moz-user-select: none; -moz-user-select: none;
-ms-user-select: none; -ms-user-select: none;
user-select: none; user-select: none;
background-color: #fff; background-color: #fff;
border: .075rem solid #ddd; border: .075rem solid #ddd;
border-radius: .25rem; border-radius: .25rem;
@@ -3278,40 +3246,11 @@ input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="butto
border-radius: 0 .25rem .25rem 0; border-radius: 0 .25rem .25rem 0;
} }
/* Focus */
.file input:focus ~ .file-custom { .file input:focus ~ .file-custom {
-webkit-box-shadow: 0 0 0 .075rem #fff, 0 0 0 .2rem #0074d9; -webkit-box-shadow: 0 0 0 .075rem #fff, 0 0 0 .2rem #0074d9;
box-shadow: 0 0 0 .075rem #fff, 0 0 0 .2rem #0074d9; box-shadow: 0 0 0 .075rem #fff, 0 0 0 .2rem #0074d9;
} }
/*
* Control layouts
*/
.controls-stacked {
margin: 1rem 0;
}
.controls-stacked .control, .controls-stacked .progress {
display: block;
}
.controls-stacked .control + .control, .controls-stacked .progress + .progress {
margin-top: .5rem;
}
.controls-inline {
margin: 1rem 0;
}
.controls-inline .control {
display: inline-block;
height: 1rem;
}
.controls-inline .control + .control {
margin-left: 1rem;
}
.nav { .nav {
margin-bottom: 0; margin-bottom: 0;
} }
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+29 -8
View File
@@ -68,14 +68,14 @@ Custom checkboxes and radios are inline to start. Add a parent with class `.c-in
Similar to the checkboxes and radios, we wrap the `<select>` in a `<label>` as a semantic wrapper that we can generate custom styles on with CSS's generated content. Similar to the checkboxes and radios, we wrap the `<select>` in a `<label>` as a semantic wrapper that we can generate custom styles on with CSS's generated content.
{% example html %} {% example html %}
<label class="select"> <label class="select">
<select> <select>
<option selected>Open this select menu</option> <option selected>Open this select menu</option>
<option value="1">One</option> <option value="1">One</option>
<option value="2">Two</option> <option value="2">Two</option>
<option value="3">Three</option> <option value="3">Three</option>
</select> </select>
</label> </label>
{% endexample %} {% endexample %}
The `<select>` has quite a few styles to override and includes a few hacks to get things done. Here's what's happening: The `<select>` has quite a few styles to override and includes a few hacks to get things done. Here's what's happening:
@@ -94,3 +94,24 @@ The `<select>` has quite a few styles to override and includes a few hacks to ge
- The custom caret is unable to receive the selected state's `color`. - The custom caret is unable to receive the selected state's `color`.
Any ideas on improving these are most welcome. Any ideas on improving these are most welcome.
## File browser
{% example html %}
<label class="file">
<input type="file" id="file">
<span class="file-custom"></span>
</label>
{% endexample %}
The file input is the most gnarly of the bunch. Here's how it works:
- We wrap the `<input>` in a `<label>` so the custom control properly triggers the file browser.
- We hide the default file `<input>` via `opacity`.
- We use `:after` to generate a custom background and directive (*Choose file...*).
- We use `:before` to generate and position the *Browse* button.
- We declare a `height` on the `<input>` for proper spacing for surrounding content.
In other words, it's an entirely custom element, all generated via CSS.
**Heads up!** The custom file input is currently unable to update the *Choose file...* text with the filename. Without JavaScript, this might not be possible to change, but I'm open to ideas.
+19 -80
View File
@@ -1887,7 +1887,6 @@ legend {
label { label {
display: inline-block; display: inline-block;
margin-bottom: 5px; margin-bottom: 5px;
font-weight: bold;
} }
input[type="search"] { input[type="search"] {
@@ -3019,7 +3018,6 @@ input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="butto
position: relative; position: relative;
display: inline; display: inline;
padding-left: 1.5rem; padding-left: 1.5rem;
font-weight: normal;
color: #555; color: #555;
cursor: pointer; cursor: pointer;
} }
@@ -3027,7 +3025,6 @@ input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="butto
position: absolute; position: absolute;
z-index: -1; z-index: -1;
opacity: 0; opacity: 0;
/* Put the input behind the label so it doesn't overlay text */
} }
.c-input > input:focus ~ .c-indicator { .c-input > input:focus ~ .c-indicator {
-webkit-box-shadow: 0 0 0 .075rem #fff, 0 0 0 .2rem #0074d9; -webkit-box-shadow: 0 0 0 .075rem #fff, 0 0 0 .2rem #0074d9;
@@ -3059,7 +3056,7 @@ input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="butto
-webkit-user-select: none; -webkit-user-select: none;
-moz-user-select: none; -moz-user-select: none;
-ms-user-select: none; -ms-user-select: none;
user-select: none; user-select: none;
background-color: #eee; background-color: #eee;
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center center; background-position: center center;
@@ -3081,7 +3078,6 @@ input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="butto
background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNy4xLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIga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MSw0LDF6Ii8+DQo8L3N2Zz4NCg==);
} }
/* Alternately, use another character */
.control-x input:checked ~ .control-indicator { .control-x input:checked ~ .control-indicator {
background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNy4xLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB3aWR0aD0iOHB4IiBoZWlnaHQ9IjhweCIgdmlld0JveD0iMCAwIDggOCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgOCA4IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxwYXRoIGZpbGw9IiNGRkZGRkYiIGQ9Ik0xLjQsMEwwLDEuNGwwLjcsMC43bDEuOCwxLjhMMC43LDUuN0wwLDYuNGwxLjQsMS40bDAuNy0wLjdsMS44LTEuOGwxLjgsMS44bDAuNywwLjdsMS40LTEuNEw3LjEsNS43DQoJTDUuMywzLjlsMS44LTEuOGwwLjctMC43TDYuNCwwTDUuNywwLjdMMy45LDIuNUwyLjEsMC43QzIuMSwwLjcsMS40LDAsMS40LDB6Ii8+DQo8L3N2Zz4NCg==); background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNy4xLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB3aWR0aD0iOHB4IiBoZWlnaHQ9IjhweCIgdmlld0JveD0iMCAwIDggOCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgOCA4IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxwYXRoIGZpbGw9IiNGRkZGRkYiIGQ9Ik0xLjQsMEwwLDEuNGwwLjcsMC43bDEuOCwxLjhMMC43LDUuN0wwLDYuNGwxLjQsMS40bDAuNy0wLjdsMS44LTEuOGwxLjgsMS44bDAuNywwLjdsMS40LTEuNEw3LjEsNS43DQoJTDUuMywzLjlsMS44LTEuOGwwLjctMC43TDYuNCwwTDUuNywwLjdMMy45LDIuNUwyLjEsMC43QzIuMSwwLjcsMS40LDAsMS40LDB6Ii8+DQo8L3N2Zz4NCg==);
} }
@@ -3095,23 +3091,19 @@ input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="butto
} }
.c-inputs-stacked .c-input:after { .c-inputs-stacked .c-input:after {
display: block; display: block;
margin-bottom: .25rem; margin-bottom: .25rem;
content: ""; content: "";
} }
.c-inputs-stacked .c-input + .c-input { .c-inputs-stacked .c-input + .c-input {
margin-left: 0; margin-left: 0;
} }
/*
* Select
*/
.select { .select {
position: relative; position: relative;
display: inline-block; display: inline-block;
color: #555; color: #555;
} }
.select > select {
.select select {
display: inline-block; display: inline-block;
width: 100%; width: 100%;
-webkit-appearance: none; -webkit-appearance: none;
@@ -3125,17 +3117,23 @@ input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="butto
border-radius: .25rem; border-radius: .25rem;
outline: 0; outline: 0;
-moz-appearance: none;
appearance: none; appearance: none;
} }
.select > select:focus {
/* Undo the Firefox inner focus ring */ -webkit-box-shadow: 0 0 0 .075rem #fff, 0 0 0 .2rem #0074d9;
.select select:focus:-moz-focusring { box-shadow: 0 0 0 .075rem #fff, 0 0 0 .2rem #0074d9;
}
.select > select:focus:-moz-focusring {
color: transparent; color: transparent;
text-shadow: 0 0 0 #000; text-shadow: 0 0 0 #000;
} }
.select > select:active {
/* Dropdown arrow */ color: #fff;
background-color: #0074d9;
}
.select > select::-ms-expand {
display: none;
}
.select:after { .select:after {
position: absolute; position: absolute;
top: 50%; top: 50%;
@@ -3152,37 +3150,11 @@ input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="butto
border-left: .35rem solid transparent; border-left: .35rem solid transparent;
} }
/* Hover state */
/* Uncomment if you need it, but be aware of the sticky iOS states.
.select select:hover {
background-color: #ddd;
}
*/
/* Focus */
.select select:focus {
-webkit-box-shadow: 0 0 0 .075rem #fff, 0 0 0 .2rem #0074d9;
box-shadow: 0 0 0 .075rem #fff, 0 0 0 .2rem #0074d9;
}
/* Active/open */
.select select:active {
color: #fff;
background-color: #0074d9;
}
/* Hide the arrow in IE10 and up */
.select select::-ms-expand {
display: none;
}
/* Media query to target Firefox only */
@-moz-document url-prefix() { @-moz-document url-prefix() {
/* Firefox hack to hide the arrow */
/* <option> elements inherit styles from <select>, so reset them. */
.select select { .select select {
padding-right: 1rem; padding-right: 1rem;
text-indent: .01px; text-indent: .01px;
text-overflow: ''; text-overflow: "";
} }
.select option { .select option {
@@ -3190,7 +3162,6 @@ input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="butto
} }
} }
/* IE9 hack to hide the arrow */
@media screen and (min-width: 0\0) { @media screen and (min-width: 0\0) {
.select select { .select select {
z-index: 1; z-index: 1;
@@ -3219,13 +3190,10 @@ input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="butto
} }
} }
/*
* File
*/
.file { .file {
position: relative; position: relative;
display: inline-block; display: inline-block;
height: 2.5rem; height: 2.5rem;
cursor: pointer; cursor: pointer;
} }
@@ -3249,7 +3217,7 @@ input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="butto
-webkit-user-select: none; -webkit-user-select: none;
-moz-user-select: none; -moz-user-select: none;
-ms-user-select: none; -ms-user-select: none;
user-select: none; user-select: none;
background-color: #fff; background-color: #fff;
border: .075rem solid #ddd; border: .075rem solid #ddd;
border-radius: .25rem; border-radius: .25rem;
@@ -3278,40 +3246,11 @@ input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="butto
border-radius: 0 .25rem .25rem 0; border-radius: 0 .25rem .25rem 0;
} }
/* Focus */
.file input:focus ~ .file-custom { .file input:focus ~ .file-custom {
-webkit-box-shadow: 0 0 0 .075rem #fff, 0 0 0 .2rem #0074d9; -webkit-box-shadow: 0 0 0 .075rem #fff, 0 0 0 .2rem #0074d9;
box-shadow: 0 0 0 .075rem #fff, 0 0 0 .2rem #0074d9; box-shadow: 0 0 0 .075rem #fff, 0 0 0 .2rem #0074d9;
} }
/*
* Control layouts
*/
.controls-stacked {
margin: 1rem 0;
}
.controls-stacked .control, .controls-stacked .progress {
display: block;
}
.controls-stacked .control + .control, .controls-stacked .progress + .progress {
margin-top: .5rem;
}
.controls-inline {
margin: 1rem 0;
}
.controls-inline .control {
display: inline-block;
height: 1rem;
}
.controls-inline .control + .control {
margin-left: 1rem;
}
.nav { .nav {
margin-bottom: 0; margin-bottom: 0;
} }
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+206 -242
View File
@@ -7,36 +7,35 @@
// Base class takes care of all the key behavioral aspects. // Base class takes care of all the key behavioral aspects.
.c-input { .c-input {
position: relative; position: relative;
display: inline; display: inline;
padding-left: 1.5rem; padding-left: 1.5rem;
color: #555; color: #555;
font-weight: normal; cursor: pointer;
cursor: pointer;
> input { > input {
position: absolute; position: absolute;
opacity: 0; z-index: -1; // Put the input behind the label so it doesn't overlay text
z-index: -1; /* Put the input behind the label so it doesn't overlay text */ opacity: 0;
&:focus ~ .c-indicator { &:focus ~ .c-indicator {
box-shadow: 0 0 0 .075rem #fff, 0 0 0 .2rem #0074d9; box-shadow: 0 0 0 .075rem #fff, 0 0 0 .2rem #0074d9;
} }
&:checked ~ .c-indicator { &:checked ~ .c-indicator {
color: #fff; color: #fff;
background-color: #0074d9; background-color: #0074d9;
} }
&:active ~ .c-indicator { &:active ~ .c-indicator {
color: #fff; color: #fff;
background-color: #84c6ff; background-color: #84c6ff;
} }
} }
+ .c-input { + .c-input {
margin-left: 1rem; margin-left: 1rem;
} }
} }
// Custom indicator // Custom indicator
@@ -44,21 +43,21 @@
// Generates a shadow element to create our makeshift checkbox/radio background. // Generates a shadow element to create our makeshift checkbox/radio background.
.c-indicator { .c-indicator {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
display: block; display: block;
width: 1rem; width: 1rem;
height: 1rem; height: 1rem;
line-height: 1rem; font-size: 65%;
font-size: 65%; line-height: 1rem;
color: #eee; color: #eee;
text-align: center; text-align: center;
background-color: #eee; user-select: none;
background-size: 50% 50%; background-color: #eee;
background-position: center center; background-repeat: no-repeat;
background-repeat: no-repeat; background-position: center center;
user-select: none; background-size: 50% 50%;
} }
// Checkboxes // Checkboxes
@@ -66,13 +65,13 @@
// Tweak just a few things for checkboxes. // Tweak just a few things for checkboxes.
.c-checkbox { .c-checkbox {
.c-indicator { .c-indicator {
border-radius: .25rem; border-radius: .25rem;
} }
input:checked ~ .c-indicator { input:checked ~ .c-indicator {
background-image: url(data:image/svg+xml;base64,PD94bWwgd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zL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgOCA4IiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA4IDgiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPHBhdGggZmlsbD0iI0ZGRkZGRiIgZD0iTTYuNCwxTDUuNywxLjdMMi45LDQuNUwyLjEsMy43TDEuNCwzTDAsNC40bDAuNywwLjdsMS41LDEuNWwwLjcsMC43bDAuNy0wLjdsMy41LTMuNWwwLjctMC43TDYuNCwxTDYuNCwxeiINCgkvPg0KPC9zdmc+DQo=);
} }
} }
// Radios // Radios
@@ -80,21 +79,21 @@
// Tweak just a few things for radios. // Tweak just a few things for radios.
.c-radio { .c-radio {
.c-indicator { .c-indicator {
border-radius: 50%; border-radius: 50%;
} }
input:checked ~ .c-indicator { input:checked ~ .c-indicator {
background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNy4xLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgOCA4IiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA4IDgiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPHBhdGggZmlsbD0iI0ZGRkZGRiIgZD0iTTQsMUMyLjMsMSwxLDIuMywxLDRzMS4zLDMsMywzczMtMS4zLDMtM1M1LjcsMSw0LDF6Ii8+DQo8L3N2Zz4NCg==); background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNy4xLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgOCA4IiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA4IDgiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPHBhdGggZmlsbD0iI0ZGRkZGRiIgZD0iTTQsMUMyLjMsMSwxLDIuMywxLDRzMS4zLDMsMywzczMtMS4zLDMtM1M1LjcsMSw0LDF6Ii8+DQo8L3N2Zz4NCg==);
} }
} }
/* Alternately, use another character */ // Alternately, use another character
.control-x input:checked ~ .control-indicator { .control-x input:checked ~ .control-indicator {
background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNy4xLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB3aWR0aD0iOHB4IiBoZWlnaHQ9IjhweCIgdmlld0JveD0iMCAwIDggOCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgOCA4IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxwYXRoIGZpbGw9IiNGRkZGRkYiIGQ9Ik0xLjQsMEwwLDEuNGwwLjcsMC43bDEuOCwxLjhMMC43LDUuN0wwLDYuNGwxLjQsMS40bDAuNy0wLjdsMS44LTEuOGwxLjgsMS44bDAuNywwLjdsMS40LTEuNEw3LjEsNS43DQoJTDUuMywzLjlsMS44LTEuOGwwLjctMC43TDYuNCwwTDUuNywwLjdMMy45LDIuNUwyLjEsMC43QzIuMSwwLjcsMS40LDAsMS40LDB6Ii8+DQo8L3N2Zz4NCg==); background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNy4xLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB3aWR0aD0iOHB4IiBoZWlnaHQ9IjhweCIgdmlld0JveD0iMCAwIDggOCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgOCA4IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxwYXRoIGZpbGw9IiNGRkZGRkYiIGQ9Ik0xLjQsMEwwLDEuNGwwLjcsMC43bDEuOCwxLjhMMC43LDUuN0wwLDYuNGwxLjQsMS40bDAuNy0wLjdsMS44LTEuOGwxLjgsMS44bDAuNywwLjdsMS40LTEuNEw3LjEsNS43DQoJTDUuMywzLjlsMS44LTEuOGwwLjctMC43TDYuNCwwTDUuNywwLjdMMy45LDIuNUwyLjEsMC43QzIuMSwwLjcsMS40LDAsMS40LDB6Ii8+DQo8L3N2Zz4NCg==);
} }
.control-dash input:checked ~ .control-indicator { .control-dash input:checked ~ .control-indicator {
background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNy4xLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NC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wIDggOCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgOCA4IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxwYXRoIGZpbGw9IiNGRkZGRkYiIGQ9Ik0wLDN2Mmg4VjNIMHoiLz4NCjwvc3ZnPg0K);
} }
// Layout options // Layout options
@@ -103,222 +102,187 @@
// set. Use these optional classes to tweak the layout. // set. Use these optional classes to tweak the layout.
.c-inputs-stacked { .c-inputs-stacked {
.c-input { .c-input {
display: inline; display: inline;
&:after { &:after {
display: block; display: block;
content: ""; margin-bottom: .25rem;
margin-bottom: .25rem; content: "";
} }
+ .c-input { + .c-input {
margin-left: 0; margin-left: 0;
} }
} }
} }
// Select
//
/* // Replaces the browser default select with a custom one.
* Select
*/
.select { .select {
position: relative; position: relative;
display: inline-block; display: inline-block;
color: #555; color: #555;
}
.select select { > select {
display: inline-block; display: inline-block;
width: 100%; width: 100%;
margin: 0; padding: .5rem 2.25rem .5rem 1rem;
padding: .5rem 2.25rem .5rem 1rem; margin: 0;
line-height: 1.5; line-height: 1.5;
color: #555; color: #555;
background-color: #eee; cursor: pointer;
border: 0; background-color: #eee;
border-radius: .25rem; border: 0;
cursor: pointer; border-radius: .25rem;
outline: 0; outline: 0;
-webkit-appearance: none; -webkit-appearance: none;
-moz-appearance: none; appearance: none;
appearance: none;
} &:focus {
/* Undo the Firefox inner focus ring */ box-shadow: 0 0 0 .075rem #fff, 0 0 0 .2rem #0074d9;
.select select:focus:-moz-focusring {
color: transparent; // Undo the Firefox inner focus ring
text-shadow: 0 0 0 #000; &:-moz-focusring {
} color: transparent;
/* Dropdown arrow */ text-shadow: 0 0 0 #000;
.select:after { }
position: absolute; }
top: 50%;
right: 1.25rem; &:active {
display: inline-block; color: #fff;
content: ""; background-color: #0074d9;
width: 0; }
height: 0;
margin-top: -.15rem; // Hide the arrow in IE10 and up
pointer-events: none; &::-ms-expand {
border-top: .35rem solid; display: none;
border-right: .35rem solid transparent; }
border-bottom: .35rem solid transparent; }
border-left: .35rem solid transparent;
// Dropdown arrow
&:after {
position: absolute;
top: 50%;
right: 1.25rem;
display: inline-block;
width: 0;
height: 0;
margin-top: -.15rem;
pointer-events: none;
content: "";
border-top: .35rem solid;
border-right: .35rem solid transparent;
border-bottom: .35rem solid transparent;
border-left: .35rem solid transparent;
}
} }
/* Hover state */ // Hover state
/* Uncomment if you need it, but be aware of the sticky iOS states. // Uncomment if you need it, but be aware of the sticky iOS states.
.select select:hover { // .select select:hover {
background-color: #ddd; // background-color: #ddd;
} // }
*/
/* Focus */
.select select:focus {
box-shadow: 0 0 0 .075rem #fff, 0 0 0 .2rem #0074d9;
}
/* Active/open */ // Media query to target Firefox only
.select select:active {
color: #fff;
background-color: #0074d9;
}
/* Hide the arrow in IE10 and up */
.select select::-ms-expand {
display: none;
}
/* Media query to target Firefox only */
@-moz-document url-prefix() { @-moz-document url-prefix() {
/* Firefox hack to hide the arrow */ // Firefox hack to hide the arrow
.select select { .select select {
text-indent: 0.01px; padding-right: 1rem;
text-overflow: ''; text-indent: 0.01px;
padding-right: 1rem; text-overflow: "";
} }
/* <option> elements inherit styles from <select>, so reset them. */ // <option> elements inherit styles from <select>, so reset them.
.select option { .select option {
background-color: #fff; background-color: #fff;
} }
} }
/* IE9 hack to hide the arrow */ // IE9 hack to hide the arrow
@media screen and (min-width:0\0) { @media screen and (min-width:0\0) {
.select select { .select select {
z-index: 1; z-index: 1;
padding: .5rem 1.5rem .5rem 1rem; padding: .5rem 1.5rem .5rem 1rem;
} }
.select:after { .select:after {
z-index: 5; z-index: 5;
} }
.select:before { .select:before {
position: absolute; position: absolute;
top: 0; top: 0;
right: 1rem; right: 1rem;
bottom: 0; bottom: 0;
z-index: 2; z-index: 2;
content: ""; display: block;
display: block; width: 1.5rem;
width: 1.5rem; content: "";
background-color: #eee; background-color: #eee;
} }
.select select:hover, .select select:hover,
.select select:focus, .select select:focus,
.select select:active { .select select:active {
color: #555; color: #555;
background-color: #eee; background-color: #eee;
} }
} }
// File
//
/* // Custom file input.
* File
*/
.file { .file {
position: relative; position: relative;
display: inline-block; display: inline-block;
cursor: pointer; height: 2.5rem;
height: 2.5rem; cursor: pointer;
} }
.file input { .file input {
min-width: 14rem; min-width: 14rem;
margin: 0; margin: 0;
filter: alpha(opacity=0); filter: alpha(opacity=0);
opacity: 0; opacity: 0;
} }
.file-custom { .file-custom {
position: absolute; position: absolute;
top: 0; top: 0;
right: 0; right: 0;
left: 0; left: 0;
z-index: 5; z-index: 5;
height: 2.5rem; height: 2.5rem;
padding: .5rem 1rem; padding: .5rem 1rem;
line-height: 1.5; line-height: 1.5;
color: #555; color: #555;
background-color: #fff; user-select: none;
border: .075rem solid #ddd; background-color: #fff;
border-radius: .25rem; border: .075rem solid #ddd;
box-shadow: inset 0 .2rem .4rem rgba(0,0,0,.05); border-radius: .25rem;
-webkit-user-select: none; box-shadow: inset 0 .2rem .4rem rgba(0,0,0,.05);
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
} }
.file-custom:after { .file-custom:after {
content: "Choose file..."; content: "Choose file...";
} }
.file-custom:before { .file-custom:before {
position: absolute; position: absolute;
top: -.075rem; top: -.075rem;
right: -.075rem; right: -.075rem;
bottom: -.075rem; bottom: -.075rem;
z-index: 6; z-index: 6;
display: block; display: block;
content: "Browse"; height: 2.5rem;
height: 2.5rem; padding: .5rem 1rem;
padding: .5rem 1rem; line-height: 1.5;
line-height: 1.5; color: #555;
color: #555; content: "Browse";
background-color: #eee; background-color: #eee;
border: .075rem solid #ddd; border: .075rem solid #ddd;
border-radius: 0 .25rem .25rem 0; border-radius: 0 .25rem .25rem 0;
} }
/* Focus */ // Focus state
.file input:focus ~ .file-custom { .file input:focus ~ .file-custom {
box-shadow: 0 0 0 .075rem #fff, 0 0 0 .2rem #0074d9; box-shadow: 0 0 0 .075rem #fff, 0 0 0 .2rem #0074d9;
}
/*
* Control layouts
*/
.controls-stacked {
margin: 1rem 0;
}
.controls-stacked .control,
.controls-stacked .progress {
display: block;
}
.controls-stacked .control + .control,
.controls-stacked .progress + .progress {
margin-top: .5rem;
}
.controls-inline {
margin: 1rem 0;
}
.controls-inline .control {
display: inline-block;
height: 1rem;
}
.controls-inline .control + .control {
margin-left: 1rem;
} }
-1
View File
@@ -32,7 +32,6 @@ legend {
label { label {
display: inline-block; display: inline-block;
margin-bottom: 5px; margin-bottom: 5px;
font-weight: bold;
} }