twitter-bootstrap-rails 1.4.3 → 2.0rc0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of twitter-bootstrap-rails might be problematic. Click here for more details.

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