cmaitchison-bootstrap-rails 2.0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/README.md +97 -0
- data/Rakefile +45 -0
- data/bootstrap-rails.gemspec +23 -0
- data/lib/bootstrap-rails.rb +13 -0
- data/lib/bootstrap-rails/engine.rb +6 -0
- data/lib/bootstrap-rails/ie_hex_str.rb +16 -0
- data/lib/bootstrap-rails/railtie.rb +5 -0
- data/lib/bootstrap-rails/version.rb +5 -0
- data/test/ie_hex_str_test.rb +26 -0
- data/test/test_helper.rb +2 -0
- data/vendor/assets/images/glyphicons-halflings-white.png +0 -0
- data/vendor/assets/images/glyphicons-halflings.png +0 -0
- data/vendor/assets/javascripts/bootstrap-alert.js +94 -0
- data/vendor/assets/javascripts/bootstrap-button.js +100 -0
- data/vendor/assets/javascripts/bootstrap-carousel.js +157 -0
- data/vendor/assets/javascripts/bootstrap-collapse.js +136 -0
- data/vendor/assets/javascripts/bootstrap-dropdown.js +92 -0
- data/vendor/assets/javascripts/bootstrap-modal.js +210 -0
- data/vendor/assets/javascripts/bootstrap-popover.js +95 -0
- data/vendor/assets/javascripts/bootstrap-scrollspy.js +125 -0
- data/vendor/assets/javascripts/bootstrap-tab.js +130 -0
- data/vendor/assets/javascripts/bootstrap-tooltip.js +270 -0
- data/vendor/assets/javascripts/bootstrap-transition.js +51 -0
- data/vendor/assets/javascripts/bootstrap-typeahead.js +271 -0
- data/vendor/assets/javascripts/bootstrap.js +12 -0
- data/vendor/assets/stylesheets/accordion.scss +28 -0
- data/vendor/assets/stylesheets/alerts.scss +70 -0
- data/vendor/assets/stylesheets/bootstrap.scss +62 -0
- data/vendor/assets/stylesheets/breadcrumbs.scss +22 -0
- data/vendor/assets/stylesheets/button-groups.scss +148 -0
- data/vendor/assets/stylesheets/buttons.scss +183 -0
- data/vendor/assets/stylesheets/carousel.scss +121 -0
- data/vendor/assets/stylesheets/close.scss +18 -0
- data/vendor/assets/stylesheets/code.scss +57 -0
- data/vendor/assets/stylesheets/component-animations.scss +18 -0
- data/vendor/assets/stylesheets/dropdowns.scss +130 -0
- data/vendor/assets/stylesheets/forms.scss +523 -0
- data/vendor/assets/stylesheets/grid.scss +8 -0
- data/vendor/assets/stylesheets/hero-unit.scss +20 -0
- data/vendor/assets/stylesheets/labels.scss +32 -0
- data/vendor/assets/stylesheets/layouts.scss +17 -0
- data/vendor/assets/stylesheets/mixins.scss +560 -0
- data/vendor/assets/stylesheets/modals.scss +83 -0
- data/vendor/assets/stylesheets/navbar.scss +299 -0
- data/vendor/assets/stylesheets/navs.scss +353 -0
- data/vendor/assets/stylesheets/pager.scss +30 -0
- data/vendor/assets/stylesheets/pagination.scss +55 -0
- data/vendor/assets/stylesheets/popovers.scss +49 -0
- data/vendor/assets/stylesheets/progress-bars.scss +95 -0
- data/vendor/assets/stylesheets/reset.scss +126 -0
- data/vendor/assets/stylesheets/responsive.scss +327 -0
- data/vendor/assets/stylesheets/scaffolding.scss +29 -0
- data/vendor/assets/stylesheets/sprites.scss +158 -0
- data/vendor/assets/stylesheets/tables.scss +141 -0
- data/vendor/assets/stylesheets/thumbnails.scss +35 -0
- data/vendor/assets/stylesheets/tooltip.scss +35 -0
- data/vendor/assets/stylesheets/type.scss +218 -0
- data/vendor/assets/stylesheets/utilities.scss +23 -0
- data/vendor/assets/stylesheets/variables.scss +107 -0
- data/vendor/assets/stylesheets/wells.scss +17 -0
- metadata +154 -0
@@ -0,0 +1,18 @@
|
|
1
|
+
// CLOSE ICONS
|
2
|
+
// -----------
|
3
|
+
|
4
|
+
.close {
|
5
|
+
float: right;
|
6
|
+
font-size: 20px;
|
7
|
+
font-weight: bold;
|
8
|
+
line-height: $baseLineHeight;
|
9
|
+
color: $black;
|
10
|
+
text-shadow: 0 1px 0 rgba(255,255,255,1);
|
11
|
+
@include opacity(20);
|
12
|
+
&:hover {
|
13
|
+
color: $black;
|
14
|
+
text-decoration: none;
|
15
|
+
@include opacity(40);
|
16
|
+
cursor: pointer;
|
17
|
+
}
|
18
|
+
}
|
@@ -0,0 +1,57 @@
|
|
1
|
+
// Code.less
|
2
|
+
// Code typography styles for the <code> and <pre> elements
|
3
|
+
// --------------------------------------------------------
|
4
|
+
|
5
|
+
// Inline and block code styles
|
6
|
+
code,
|
7
|
+
pre {
|
8
|
+
padding: 0 3px 2px;
|
9
|
+
@include font-family-monospace;
|
10
|
+
font-size: $baseFontSize - 1;
|
11
|
+
color: $grayDark;
|
12
|
+
@include border-radius(3px);
|
13
|
+
}
|
14
|
+
|
15
|
+
// Inline code
|
16
|
+
code {
|
17
|
+
padding: 3px 4px;
|
18
|
+
color: #d14;
|
19
|
+
background-color: #f7f7f9;
|
20
|
+
border: 1px solid #e1e1e8;
|
21
|
+
}
|
22
|
+
|
23
|
+
// Blocks of code
|
24
|
+
pre {
|
25
|
+
display: block;
|
26
|
+
padding: ($baseLineHeight - 1) / 2;
|
27
|
+
margin: 0 0 $baseLineHeight / 2;
|
28
|
+
font-size: 12px;
|
29
|
+
line-height: $baseLineHeight;
|
30
|
+
background-color: #f5f5f5;
|
31
|
+
border: 1px solid #ccc; // fallback for IE7-8
|
32
|
+
border: 1px solid rgba(0,0,0,.15);
|
33
|
+
@include border-radius(4px);
|
34
|
+
white-space: pre;
|
35
|
+
white-space: pre-wrap;
|
36
|
+
word-break: break-all;
|
37
|
+
word-wrap: break-word;
|
38
|
+
|
39
|
+
// Make prettyprint styles more spaced out for readability
|
40
|
+
&.prettyprint {
|
41
|
+
margin-bottom: $baseLineHeight;
|
42
|
+
}
|
43
|
+
|
44
|
+
// Account for some code outputs that place code tags in pre tags
|
45
|
+
code {
|
46
|
+
padding: 0;
|
47
|
+
color: inherit;
|
48
|
+
background-color: transparent;
|
49
|
+
border: 0;
|
50
|
+
}
|
51
|
+
}
|
52
|
+
|
53
|
+
// Enable scrollable blocks of code
|
54
|
+
.pre-scrollable {
|
55
|
+
max-height: 340px;
|
56
|
+
overflow-y: scroll;
|
57
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
// COMPONENT ANIMATIONS
|
2
|
+
// --------------------
|
3
|
+
|
4
|
+
.fade {
|
5
|
+
@include transition(opacity .15s linear);
|
6
|
+
opacity: 0;
|
7
|
+
&.in {
|
8
|
+
opacity: 1;
|
9
|
+
}
|
10
|
+
}
|
11
|
+
|
12
|
+
.collapse {
|
13
|
+
@include transition(height .35s ease);
|
14
|
+
position:relative;
|
15
|
+
overflow:hidden;
|
16
|
+
height: 0;
|
17
|
+
&.in { height: auto; }
|
18
|
+
}
|
@@ -0,0 +1,130 @@
|
|
1
|
+
// DROPDOWN MENUS
|
2
|
+
// --------------
|
3
|
+
|
4
|
+
// Use the .menu class on any <li> element within the topbar or ul.tabs and you'll get some superfancy dropdowns
|
5
|
+
.dropdown {
|
6
|
+
position: relative;
|
7
|
+
}
|
8
|
+
.dropdown-toggle {
|
9
|
+
// The caret makes the toggle a bit too tall in IE7
|
10
|
+
*margin-bottom: -3px;
|
11
|
+
}
|
12
|
+
.dropdown-toggle:active,
|
13
|
+
.open .dropdown-toggle {
|
14
|
+
outline: 0;
|
15
|
+
}
|
16
|
+
// Dropdown arrow/caret
|
17
|
+
.caret {
|
18
|
+
display: inline-block;
|
19
|
+
width: 0;
|
20
|
+
height: 0;
|
21
|
+
text-indent: -99999px;
|
22
|
+
// IE7 won't do the border trick if there's a text indent, but it doesn't
|
23
|
+
// do the content that text-indent is hiding, either, so we're ok.
|
24
|
+
*text-indent: 0;
|
25
|
+
vertical-align: top;
|
26
|
+
border-left: 4px solid transparent;
|
27
|
+
border-right: 4px solid transparent;
|
28
|
+
border-top: 4px solid $black;
|
29
|
+
@include opacity(30);
|
30
|
+
content: "\2193";
|
31
|
+
}
|
32
|
+
.dropdown .caret {
|
33
|
+
margin-top: 8px;
|
34
|
+
margin-left: 2px;
|
35
|
+
}
|
36
|
+
.dropdown:hover .caret,
|
37
|
+
.open.dropdown .caret {
|
38
|
+
@include opacity(100);
|
39
|
+
}
|
40
|
+
// The dropdown menu (ul)
|
41
|
+
.dropdown-menu {
|
42
|
+
position: absolute;
|
43
|
+
top: 100%;
|
44
|
+
left: 0;
|
45
|
+
z-index: $zindexDropdown;
|
46
|
+
float: left;
|
47
|
+
display: none; // none by default, but block on "open" of the menu
|
48
|
+
min-width: 160px;
|
49
|
+
_width: 160px;
|
50
|
+
padding: 4px 0;
|
51
|
+
margin: 0; // override default ul
|
52
|
+
list-style: none;
|
53
|
+
background-color: $white;
|
54
|
+
border-color: #ccc;
|
55
|
+
border-color: rgba(0,0,0,.2);
|
56
|
+
border-style: solid;
|
57
|
+
border-width: 1px;
|
58
|
+
@include border-radius(0 0 5px 5px);
|
59
|
+
@include box-shadow(0 5px 10px rgba(0,0,0,.2));
|
60
|
+
-webkit-background-clip: padding-box;
|
61
|
+
-moz-background-clip: padding;
|
62
|
+
background-clip: padding-box;
|
63
|
+
*border-right-width: 2px;
|
64
|
+
*border-bottom-width: 2px;
|
65
|
+
|
66
|
+
// Allow for dropdowns to go bottom up (aka, dropup-menu)
|
67
|
+
&.bottom-up {
|
68
|
+
top: auto;
|
69
|
+
bottom: 100%;
|
70
|
+
margin-bottom: 2px;
|
71
|
+
}
|
72
|
+
|
73
|
+
// Dividers (basically an hr) within the dropdown
|
74
|
+
.divider {
|
75
|
+
height: 1px;
|
76
|
+
margin: 5px 1px;
|
77
|
+
overflow: hidden;
|
78
|
+
background-color: #e5e5e5;
|
79
|
+
border-bottom: 1px solid $white;
|
80
|
+
|
81
|
+
// IE7 needs a set width since we gave a height. Restricting just
|
82
|
+
// to IE7 to keep the 1px left/right space in other browsers.
|
83
|
+
// It is unclear where IE is getting the extra space that we need
|
84
|
+
// to negative-margin away, but so it goes.
|
85
|
+
*width: 100%;
|
86
|
+
*margin: -5px 0 5px;
|
87
|
+
}
|
88
|
+
|
89
|
+
// Links within the dropdown menu
|
90
|
+
a {
|
91
|
+
display: block;
|
92
|
+
padding: 3px 15px;
|
93
|
+
clear: both;
|
94
|
+
font-weight: normal;
|
95
|
+
line-height: $baseLineHeight;
|
96
|
+
color: $gray;
|
97
|
+
white-space: nowrap;
|
98
|
+
}
|
99
|
+
}
|
100
|
+
|
101
|
+
// Hover state
|
102
|
+
.dropdown-menu li > a:hover,
|
103
|
+
.dropdown-menu .active > a,
|
104
|
+
.dropdown-menu .active > a:hover {
|
105
|
+
color: $white;
|
106
|
+
text-decoration: none;
|
107
|
+
background-color: $linkColor;
|
108
|
+
}
|
109
|
+
|
110
|
+
// Open state for the dropdown
|
111
|
+
.dropdown.open {
|
112
|
+
// IE7's z-index only goes to the nearest positioned ancestor, which would
|
113
|
+
// make the menu appear below buttons that appeared later on the page
|
114
|
+
*z-index: $zindexDropdown;
|
115
|
+
|
116
|
+
.dropdown-toggle {
|
117
|
+
color: $white;
|
118
|
+
background: #ccc;
|
119
|
+
background: rgba(0,0,0,.3);
|
120
|
+
}
|
121
|
+
.dropdown-menu {
|
122
|
+
display: block;
|
123
|
+
}
|
124
|
+
}
|
125
|
+
|
126
|
+
// Typeahead
|
127
|
+
.typeahead {
|
128
|
+
margin-top: 2px; // give it some space to breathe
|
129
|
+
@include border-radius(4px);
|
130
|
+
}
|
@@ -0,0 +1,523 @@
|
|
1
|
+
// Forms.less
|
2
|
+
// Base styles for various input types, form layouts, and states
|
3
|
+
// -------------------------------------------------------------
|
4
|
+
|
5
|
+
|
6
|
+
// GENERAL STYLES
|
7
|
+
// --------------
|
8
|
+
|
9
|
+
// Make all forms have space below them
|
10
|
+
form {
|
11
|
+
margin: 0 0 $baseLineHeight;
|
12
|
+
}
|
13
|
+
|
14
|
+
fieldset {
|
15
|
+
padding: 0;
|
16
|
+
margin: 0;
|
17
|
+
border: 0;
|
18
|
+
}
|
19
|
+
|
20
|
+
// Groups of fields with labels on top (legends)
|
21
|
+
legend {
|
22
|
+
display: block;
|
23
|
+
width: 100%;
|
24
|
+
padding: 0;
|
25
|
+
margin-bottom: $baseLineHeight * 1.5;
|
26
|
+
font-size: $baseFontSize * 1.5;
|
27
|
+
line-height: $baseLineHeight * 2;
|
28
|
+
color: $grayDark;
|
29
|
+
border: 0;
|
30
|
+
border-bottom: 1px solid #eee;
|
31
|
+
|
32
|
+
// Small
|
33
|
+
small {
|
34
|
+
font-size: $baseLineHeight * .75;
|
35
|
+
color: $grayLight;
|
36
|
+
}
|
37
|
+
}
|
38
|
+
|
39
|
+
// Set font for forms
|
40
|
+
label,
|
41
|
+
input,
|
42
|
+
button,
|
43
|
+
select,
|
44
|
+
textarea {
|
45
|
+
@include font-shorthand($baseFontSize,normal,$baseLineHeight); // Set size, weight, line-height here
|
46
|
+
}
|
47
|
+
input,
|
48
|
+
button,
|
49
|
+
select,
|
50
|
+
textarea {
|
51
|
+
@include font-family-sans-serif(); // And only set font-family here for those that need it (note the missing label element)
|
52
|
+
}
|
53
|
+
|
54
|
+
// Identify controls by their labels
|
55
|
+
label {
|
56
|
+
display: block;
|
57
|
+
margin-bottom: 5px;
|
58
|
+
color: $grayDark;
|
59
|
+
}
|
60
|
+
|
61
|
+
// Inputs, Textareas, Selects
|
62
|
+
input,
|
63
|
+
textarea,
|
64
|
+
select,
|
65
|
+
.uneditable-input {
|
66
|
+
display: inline-block;
|
67
|
+
width: 210px;
|
68
|
+
height: $baseLineHeight;
|
69
|
+
padding: 4px;
|
70
|
+
margin-bottom: 9px;
|
71
|
+
font-size: $baseFontSize;
|
72
|
+
line-height: $baseLineHeight;
|
73
|
+
color: $gray;
|
74
|
+
border: 1px solid #ccc;
|
75
|
+
@include border-radius(3px);
|
76
|
+
}
|
77
|
+
.uneditable-textarea {
|
78
|
+
width: auto;
|
79
|
+
height: auto;
|
80
|
+
}
|
81
|
+
|
82
|
+
// Inputs within a label
|
83
|
+
label input,
|
84
|
+
label textarea,
|
85
|
+
label select {
|
86
|
+
display: block;
|
87
|
+
}
|
88
|
+
|
89
|
+
// Mini reset for unique input types
|
90
|
+
input[type="image"],
|
91
|
+
input[type="checkbox"],
|
92
|
+
input[type="radio"] {
|
93
|
+
width: auto;
|
94
|
+
height: auto;
|
95
|
+
padding: 0;
|
96
|
+
margin: 3px 0;
|
97
|
+
*margin-top: 0; /* IE7 */
|
98
|
+
line-height: normal;
|
99
|
+
cursor: pointer;
|
100
|
+
@include border-radius(0);
|
101
|
+
border: 0 \9; /* IE9 and down */
|
102
|
+
}
|
103
|
+
input[type="image"] {
|
104
|
+
border: 0;
|
105
|
+
}
|
106
|
+
|
107
|
+
// Reset the file input to browser defaults
|
108
|
+
input[type="file"] {
|
109
|
+
width: auto;
|
110
|
+
padding: initial;
|
111
|
+
line-height: initial;
|
112
|
+
border: initial;
|
113
|
+
background-color: $white;
|
114
|
+
background-color: initial;
|
115
|
+
@include box-shadow(none);
|
116
|
+
}
|
117
|
+
|
118
|
+
// Help out input buttons
|
119
|
+
input[type="button"],
|
120
|
+
input[type="reset"],
|
121
|
+
input[type="submit"] {
|
122
|
+
width: auto;
|
123
|
+
height: auto;
|
124
|
+
}
|
125
|
+
|
126
|
+
// Set the height of select and file controls to match text inputs
|
127
|
+
select,
|
128
|
+
input[type="file"] {
|
129
|
+
height: 28px; /* In IE7, the height of the select element cannot be changed by height, only font-size */
|
130
|
+
*margin-top: 4px; /* For IE7, add top margin to align select with labels */
|
131
|
+
line-height: 28px;
|
132
|
+
}
|
133
|
+
|
134
|
+
// Reset line-height for IE
|
135
|
+
input[type="file"] {
|
136
|
+
line-height: 18px \9;
|
137
|
+
}
|
138
|
+
|
139
|
+
// Chrome on Linux and Mobile Safari need background-color
|
140
|
+
select {
|
141
|
+
width: 220px; // default input width + 10px of padding that doesn't get applied
|
142
|
+
background-color: $white;
|
143
|
+
}
|
144
|
+
|
145
|
+
// Make multiple select elements height not fixed
|
146
|
+
select[multiple],
|
147
|
+
select[size] {
|
148
|
+
height: auto;
|
149
|
+
}
|
150
|
+
|
151
|
+
// Remove shadow from image inputs
|
152
|
+
input[type="image"] {
|
153
|
+
@include box-shadow(none);
|
154
|
+
}
|
155
|
+
|
156
|
+
// Make textarea height behave
|
157
|
+
textarea {
|
158
|
+
height: auto;
|
159
|
+
}
|
160
|
+
|
161
|
+
// Hidden inputs
|
162
|
+
input[type="hidden"] {
|
163
|
+
display: none;
|
164
|
+
}
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
// CHECKBOXES & RADIOS
|
169
|
+
// -------------------
|
170
|
+
|
171
|
+
// Indent the labels to position radios/checkboxes as hanging
|
172
|
+
.radio,
|
173
|
+
.checkbox {
|
174
|
+
padding-left: 18px;
|
175
|
+
}
|
176
|
+
.radio input[type="radio"],
|
177
|
+
.checkbox input[type="checkbox"] {
|
178
|
+
float: left;
|
179
|
+
margin-left: -18px;
|
180
|
+
}
|
181
|
+
|
182
|
+
// Move the options list down to align with labels
|
183
|
+
.controls > .radio:first-child,
|
184
|
+
.controls > .checkbox:first-child {
|
185
|
+
padding-top: 5px; // has to be padding because margin collaspes
|
186
|
+
}
|
187
|
+
|
188
|
+
// Radios and checkboxes on same line
|
189
|
+
// TODO v3: Convert .inline to .control-inline
|
190
|
+
.radio.inline,
|
191
|
+
.checkbox.inline {
|
192
|
+
display: inline-block;
|
193
|
+
padding-top: 5px;
|
194
|
+
margin-bottom: 0;
|
195
|
+
vertical-align: middle;
|
196
|
+
}
|
197
|
+
.radio.inline + .radio.inline,
|
198
|
+
.checkbox.inline + .checkbox.inline {
|
199
|
+
margin-left: 10px; // space out consecutive inline controls
|
200
|
+
}
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
// FOCUS STATE
|
205
|
+
// -----------
|
206
|
+
|
207
|
+
input,
|
208
|
+
textarea {
|
209
|
+
@include box-shadow(inset 0 1px 1px rgba(0,0,0,.075));
|
210
|
+
$transition: border linear .2s, box-shadow linear .2s;
|
211
|
+
@include transition($transition);
|
212
|
+
}
|
213
|
+
input:focus,
|
214
|
+
textarea:focus {
|
215
|
+
border-color: rgba(82,168,236,.8);
|
216
|
+
$shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);
|
217
|
+
@include box-shadow($shadow);
|
218
|
+
outline: 0;
|
219
|
+
outline: thin dotted \9; /* IE6-9 */
|
220
|
+
}
|
221
|
+
input[type="file"]:focus,
|
222
|
+
input[type="radio"]:focus,
|
223
|
+
input[type="checkbox"]:focus,
|
224
|
+
select:focus {
|
225
|
+
@include box-shadow(none); // override for file inputs
|
226
|
+
@include tab-focus();
|
227
|
+
}
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
// INPUT SIZES
|
232
|
+
// -----------
|
233
|
+
|
234
|
+
// General classes for quick sizes
|
235
|
+
.input-mini { width: 60px; }
|
236
|
+
.input-small { width: 90px; }
|
237
|
+
.input-medium { width: 150px; }
|
238
|
+
.input-large { width: 210px; }
|
239
|
+
.input-xlarge { width: 270px; }
|
240
|
+
.input-xxlarge { width: 530px; }
|
241
|
+
|
242
|
+
// Grid style input sizes
|
243
|
+
input[class*="span"],
|
244
|
+
select[class*="span"],
|
245
|
+
textarea[class*="span"],
|
246
|
+
.uneditable-input {
|
247
|
+
float: none;
|
248
|
+
margin-left: 0;
|
249
|
+
}
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
// GRID SIZING FOR INPUTS
|
254
|
+
// ----------------------
|
255
|
+
|
256
|
+
@include input-grid-system-generate($gridColumns, $gridColumnWidth, $gridGutterWidth);
|
257
|
+
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
// DISABLED STATE
|
263
|
+
// --------------
|
264
|
+
|
265
|
+
// Disabled and read-only inputs
|
266
|
+
input[disabled],
|
267
|
+
select[disabled],
|
268
|
+
textarea[disabled],
|
269
|
+
input[readonly],
|
270
|
+
select[readonly],
|
271
|
+
textarea[readonly] {
|
272
|
+
background-color: #f5f5f5;
|
273
|
+
border-color: #ddd;
|
274
|
+
cursor: not-allowed;
|
275
|
+
}
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
|
280
|
+
// FORM FIELD FEEDBACK STATES
|
281
|
+
// --------------------------
|
282
|
+
|
283
|
+
// Warning
|
284
|
+
.control-group.warning {
|
285
|
+
@include form-field-state($warningText, $warningText, $warningBackground);
|
286
|
+
}
|
287
|
+
// Error
|
288
|
+
.control-group.error {
|
289
|
+
@include form-field-state($errorText, $errorText, $errorBackground);
|
290
|
+
}
|
291
|
+
// Success
|
292
|
+
.control-group.success {
|
293
|
+
@include form-field-state($successText, $successText, $successBackground);
|
294
|
+
}
|
295
|
+
|
296
|
+
// HTML5 invalid states
|
297
|
+
// Shares styles with the .control-group.error above
|
298
|
+
input:focus:required:invalid,
|
299
|
+
textarea:focus:required:invalid,
|
300
|
+
select:focus:required:invalid {
|
301
|
+
color: #b94a48;
|
302
|
+
border-color: #ee5f5b;
|
303
|
+
&:focus {
|
304
|
+
border-color: darken(#ee5f5b, 10%);
|
305
|
+
@include box-shadow(0 0 6px lighten(#ee5f5b, 20%));
|
306
|
+
}
|
307
|
+
}
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
// FORM ACTIONS
|
312
|
+
// ------------
|
313
|
+
|
314
|
+
.form-actions {
|
315
|
+
padding: ($baseLineHeight - 1) 20px $baseLineHeight;
|
316
|
+
margin-top: $baseLineHeight;
|
317
|
+
margin-bottom: $baseLineHeight;
|
318
|
+
background-color: #f5f5f5;
|
319
|
+
border-top: 1px solid #ddd;
|
320
|
+
}
|
321
|
+
|
322
|
+
// For text that needs to appear as an input but should not be an input
|
323
|
+
.uneditable-input {
|
324
|
+
display: block;
|
325
|
+
background-color: $white;
|
326
|
+
border-color: #eee;
|
327
|
+
@include box-shadow(inset 0 1px 2px rgba(0,0,0,.025));
|
328
|
+
cursor: not-allowed;
|
329
|
+
}
|
330
|
+
|
331
|
+
// Placeholder text gets special styles; can't be bundled together though for some reason
|
332
|
+
@include placeholder($grayLight);
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
// HELP TEXT
|
337
|
+
// ---------
|
338
|
+
|
339
|
+
.help-block {
|
340
|
+
display: block; // account for any element using help-block
|
341
|
+
margin-top: 5px;
|
342
|
+
margin-bottom: 0;
|
343
|
+
color: $grayLight;
|
344
|
+
}
|
345
|
+
|
346
|
+
.help-inline {
|
347
|
+
display: inline-block;
|
348
|
+
@include ie7-inline-block();
|
349
|
+
margin-bottom: 9px;
|
350
|
+
vertical-align: middle;
|
351
|
+
padding-left: 5px;
|
352
|
+
}
|
353
|
+
|
354
|
+
|
355
|
+
|
356
|
+
// INPUT GROUPS
|
357
|
+
// ------------
|
358
|
+
|
359
|
+
// Allow us to put symbols and text within the input field for a cleaner look
|
360
|
+
.input-prepend,
|
361
|
+
.input-append {
|
362
|
+
margin-bottom: 5px;
|
363
|
+
@include clearfix(); // Clear the float to prevent wrapping
|
364
|
+
input,
|
365
|
+
.uneditable-input {
|
366
|
+
@include border-radius(0 3px 3px 0);
|
367
|
+
&:focus {
|
368
|
+
position: relative;
|
369
|
+
z-index: 2;
|
370
|
+
}
|
371
|
+
}
|
372
|
+
.uneditable-input {
|
373
|
+
border-left-color: #ccc;
|
374
|
+
}
|
375
|
+
.add-on {
|
376
|
+
float: left;
|
377
|
+
display: block;
|
378
|
+
width: auto;
|
379
|
+
min-width: 16px;
|
380
|
+
height: $baseLineHeight;
|
381
|
+
margin-right: -1px;
|
382
|
+
padding: 4px 5px;
|
383
|
+
font-weight: normal;
|
384
|
+
line-height: $baseLineHeight;
|
385
|
+
color: $grayLight;
|
386
|
+
text-align: center;
|
387
|
+
text-shadow: 0 1px 0 $white;
|
388
|
+
background-color: #f5f5f5;
|
389
|
+
border: 1px solid #ccc;
|
390
|
+
@include border-radius(3px 0 0 3px);
|
391
|
+
}
|
392
|
+
.active {
|
393
|
+
background-color: lighten($green, 30);
|
394
|
+
border-color: $green;
|
395
|
+
}
|
396
|
+
}
|
397
|
+
.input-prepend {
|
398
|
+
.add-on {
|
399
|
+
*margin-top: 1px; /* IE6-7 */
|
400
|
+
}
|
401
|
+
}
|
402
|
+
.input-append {
|
403
|
+
input,
|
404
|
+
.uneditable-input {
|
405
|
+
float: left;
|
406
|
+
@include border-radius(3px 0 0 3px);
|
407
|
+
}
|
408
|
+
.uneditable-input {
|
409
|
+
border-left-color: #eee;
|
410
|
+
border-right-color: #ccc;
|
411
|
+
}
|
412
|
+
.add-on {
|
413
|
+
margin-right: 0;
|
414
|
+
margin-left: -1px;
|
415
|
+
@include border-radius(0 3px 3px 0);
|
416
|
+
}
|
417
|
+
input:first-child {
|
418
|
+
// In IE7, having a hasLayout container (from clearfix's zoom:1) can make the first input
|
419
|
+
// inherit the sum of its ancestors' margins.
|
420
|
+
*margin-left: -160px;
|
421
|
+
|
422
|
+
&+.add-on {
|
423
|
+
*margin-left: -21px;
|
424
|
+
}
|
425
|
+
}
|
426
|
+
}
|
427
|
+
|
428
|
+
|
429
|
+
|
430
|
+
// SEARCH FORM
|
431
|
+
// -----------
|
432
|
+
|
433
|
+
.search-query {
|
434
|
+
padding-left: 14px;
|
435
|
+
padding-right: 14px;
|
436
|
+
margin-bottom: 0; // remove the default margin on all inputs
|
437
|
+
@include border-radius(14px);
|
438
|
+
}
|
439
|
+
|
440
|
+
|
441
|
+
|
442
|
+
// HORIZONTAL & VERTICAL FORMS
|
443
|
+
// ---------------------------
|
444
|
+
|
445
|
+
// Common properties
|
446
|
+
// -----------------
|
447
|
+
|
448
|
+
.form-search,
|
449
|
+
.form-inline,
|
450
|
+
.form-horizontal {
|
451
|
+
input,
|
452
|
+
textarea,
|
453
|
+
select,
|
454
|
+
.help-inline,
|
455
|
+
.uneditable-input {
|
456
|
+
display: inline-block;
|
457
|
+
margin-bottom: 0;
|
458
|
+
}
|
459
|
+
// Re-hide hidden elements due to specifity
|
460
|
+
.hide {
|
461
|
+
display: none;
|
462
|
+
}
|
463
|
+
}
|
464
|
+
.form-search label,
|
465
|
+
.form-inline label,
|
466
|
+
.form-search .input-append,
|
467
|
+
.form-inline .input-append,
|
468
|
+
.form-search .input-prepend,
|
469
|
+
.form-inline .input-prepend {
|
470
|
+
display: inline-block;
|
471
|
+
}
|
472
|
+
// Make the prepend and append add-on vertical-align: middle;
|
473
|
+
.form-search .input-append .add-on,
|
474
|
+
.form-inline .input-prepend .add-on,
|
475
|
+
.form-search .input-append .add-on,
|
476
|
+
.form-inline .input-prepend .add-on {
|
477
|
+
vertical-align: middle;
|
478
|
+
}
|
479
|
+
// Inline checkbox/radio labels
|
480
|
+
.form-search .radio,
|
481
|
+
.form-inline .radio,
|
482
|
+
.form-search .checkbox,
|
483
|
+
.form-inline .checkbox {
|
484
|
+
margin-bottom: 0;
|
485
|
+
vertical-align: middle;
|
486
|
+
}
|
487
|
+
|
488
|
+
// Margin to space out fieldsets
|
489
|
+
.control-group {
|
490
|
+
margin-bottom: $baseLineHeight / 2;
|
491
|
+
}
|
492
|
+
|
493
|
+
// Legend collapses margin, so next element is responsible for spacing
|
494
|
+
legend + .control-group {
|
495
|
+
margin-top: $baseLineHeight;
|
496
|
+
-webkit-margin-top-collapse: separate;
|
497
|
+
}
|
498
|
+
|
499
|
+
// Horizontal-specific styles
|
500
|
+
// --------------------------
|
501
|
+
|
502
|
+
.form-horizontal {
|
503
|
+
// Increase spacing between groups
|
504
|
+
.control-group {
|
505
|
+
margin-bottom: $baseLineHeight;
|
506
|
+
@include clearfix();
|
507
|
+
}
|
508
|
+
// Float the labels left
|
509
|
+
.control-label {
|
510
|
+
float: left;
|
511
|
+
width: 140px;
|
512
|
+
padding-top: 5px;
|
513
|
+
text-align: right;
|
514
|
+
}
|
515
|
+
// Move over all input controls and content
|
516
|
+
.controls {
|
517
|
+
margin-left: 160px;
|
518
|
+
}
|
519
|
+
// Move over buttons in .form-actions to align with .controls
|
520
|
+
.form-actions {
|
521
|
+
padding-left: 160px;
|
522
|
+
}
|
523
|
+
}
|