bootstrap-generators 3.1.1.3 → 3.2.0

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.
Files changed (142) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +4 -5
  3. data/README.md +8 -8
  4. data/Rakefile +7 -5
  5. data/lib/bootstrap/generators/version.rb +1 -1
  6. data/lib/generators/bootstrap/install/templates/assets/stylesheets/bootstrap-variables.less +40 -23
  7. data/lib/generators/bootstrap/install/templates/assets/stylesheets/bootstrap-variables.scss +41 -24
  8. data/vendor/assets/javascripts/bootstrap.js +6 -6
  9. data/vendor/assets/javascripts/bootstrap/affix.js +19 -14
  10. data/vendor/assets/javascripts/bootstrap/alert.js +10 -6
  11. data/vendor/assets/javascripts/bootstrap/button.js +11 -8
  12. data/vendor/assets/javascripts/bootstrap/carousel.js +49 -31
  13. data/vendor/assets/javascripts/bootstrap/collapse.js +22 -22
  14. data/vendor/assets/javascripts/bootstrap/dropdown.js +17 -13
  15. data/vendor/assets/javascripts/bootstrap/modal.js +66 -29
  16. data/vendor/assets/javascripts/bootstrap/popover.js +10 -7
  17. data/vendor/assets/javascripts/bootstrap/scrollspy.js +40 -23
  18. data/vendor/assets/javascripts/bootstrap/tab.js +11 -8
  19. data/vendor/assets/javascripts/bootstrap/tooltip.js +115 -57
  20. data/vendor/assets/javascripts/bootstrap/transition.js +18 -7
  21. data/vendor/assets/stylesheets/bootstrap.css.erb +2740 -2322
  22. data/vendor/twitter/bootstrap/less/alerts.less +4 -3
  23. data/vendor/twitter/bootstrap/less/badges.less +18 -18
  24. data/vendor/twitter/bootstrap/less/bootstrap.less +3 -2
  25. data/vendor/twitter/bootstrap/less/button-groups.less +16 -2
  26. data/vendor/twitter/bootstrap/less/buttons.less +0 -2
  27. data/vendor/twitter/bootstrap/less/carousel.less +15 -4
  28. data/vendor/twitter/bootstrap/less/code.less +6 -1
  29. data/vendor/twitter/bootstrap/less/component-animations.less +6 -4
  30. data/vendor/twitter/bootstrap/less/dropdowns.less +2 -0
  31. data/vendor/twitter/bootstrap/less/forms.less +144 -42
  32. data/vendor/twitter/bootstrap/less/glyphicons.less +5 -5
  33. data/vendor/twitter/bootstrap/less/input-groups.less +6 -2
  34. data/vendor/twitter/bootstrap/less/jumbotron.less +4 -0
  35. data/vendor/twitter/bootstrap/less/labels.less +1 -1
  36. data/vendor/twitter/bootstrap/less/list-group.less +22 -1
  37. data/vendor/twitter/bootstrap/less/mixins.less +35 -925
  38. data/vendor/twitter/bootstrap/less/mixins/alerts.less +14 -0
  39. data/vendor/twitter/bootstrap/less/mixins/background-variant.less +8 -0
  40. data/vendor/twitter/bootstrap/less/mixins/border-radius.less +18 -0
  41. data/vendor/twitter/bootstrap/less/mixins/buttons.less +50 -0
  42. data/vendor/twitter/bootstrap/less/mixins/center-block.less +7 -0
  43. data/vendor/twitter/bootstrap/less/mixins/clearfix.less +22 -0
  44. data/vendor/twitter/bootstrap/less/mixins/forms.less +81 -0
  45. data/vendor/twitter/bootstrap/less/mixins/gradients.less +59 -0
  46. data/vendor/twitter/bootstrap/less/mixins/grid-framework.less +91 -0
  47. data/vendor/twitter/bootstrap/less/mixins/grid.less +122 -0
  48. data/vendor/twitter/bootstrap/less/mixins/hide-text.less +21 -0
  49. data/vendor/twitter/bootstrap/less/mixins/image.less +34 -0
  50. data/vendor/twitter/bootstrap/less/mixins/labels.less +12 -0
  51. data/vendor/twitter/bootstrap/less/mixins/list-group.less +29 -0
  52. data/vendor/twitter/bootstrap/less/mixins/nav-divider.less +10 -0
  53. data/vendor/twitter/bootstrap/less/mixins/nav-vertical-align.less +9 -0
  54. data/vendor/twitter/bootstrap/less/mixins/opacity.less +8 -0
  55. data/vendor/twitter/bootstrap/less/mixins/pagination.less +23 -0
  56. data/vendor/twitter/bootstrap/less/mixins/panels.less +24 -0
  57. data/vendor/twitter/bootstrap/less/mixins/progress-bar.less +10 -0
  58. data/vendor/twitter/bootstrap/less/mixins/reset-filter.less +8 -0
  59. data/vendor/twitter/bootstrap/less/mixins/resize.less +6 -0
  60. data/vendor/twitter/bootstrap/less/mixins/responsive-visibility.less +15 -0
  61. data/vendor/twitter/bootstrap/less/mixins/size.less +10 -0
  62. data/vendor/twitter/bootstrap/less/mixins/tab-focus.less +9 -0
  63. data/vendor/twitter/bootstrap/less/mixins/table-row.less +28 -0
  64. data/vendor/twitter/bootstrap/less/mixins/text-emphasis.less +8 -0
  65. data/vendor/twitter/bootstrap/less/mixins/text-overflow.less +8 -0
  66. data/vendor/twitter/bootstrap/less/mixins/vendor-prefixes.less +224 -0
  67. data/vendor/twitter/bootstrap/less/modals.less +18 -7
  68. data/vendor/twitter/bootstrap/less/navbar.less +41 -2
  69. data/vendor/twitter/bootstrap/less/navs.less +1 -1
  70. data/vendor/twitter/bootstrap/less/normalize.less +20 -18
  71. data/vendor/twitter/bootstrap/less/panels.less +8 -6
  72. data/vendor/twitter/bootstrap/less/popovers.less +1 -1
  73. data/vendor/twitter/bootstrap/less/progress-bars.less +27 -2
  74. data/vendor/twitter/bootstrap/less/responsive-embed.less +34 -0
  75. data/vendor/twitter/bootstrap/less/responsive-utilities.less +103 -1
  76. data/vendor/twitter/bootstrap/less/scaffolding.less +17 -1
  77. data/vendor/twitter/bootstrap/less/tables.less +4 -4
  78. data/vendor/twitter/bootstrap/less/theme.less +11 -0
  79. data/vendor/twitter/bootstrap/less/type.less +32 -12
  80. data/vendor/twitter/bootstrap/less/utilities.less +1 -0
  81. data/vendor/twitter/bootstrap/less/variables.less +40 -23
  82. data/vendor/twitter/bootstrap/sass/_alerts.scss +4 -3
  83. data/vendor/twitter/bootstrap/sass/_badges.scss +13 -11
  84. data/vendor/twitter/bootstrap/sass/_button-groups.scss +16 -2
  85. data/vendor/twitter/bootstrap/sass/_buttons.scss +0 -2
  86. data/vendor/twitter/bootstrap/sass/_carousel.scss +15 -4
  87. data/vendor/twitter/bootstrap/sass/_code.scss +6 -1
  88. data/vendor/twitter/bootstrap/sass/_component-animations.scss +10 -4
  89. data/vendor/twitter/bootstrap/sass/_dropdowns.scss +2 -0
  90. data/vendor/twitter/bootstrap/sass/_forms.scss +144 -42
  91. data/vendor/twitter/bootstrap/sass/_glyphicons.scss +4 -0
  92. data/vendor/twitter/bootstrap/sass/_input-groups.scss +6 -2
  93. data/vendor/twitter/bootstrap/sass/_jumbotron.scss +4 -0
  94. data/vendor/twitter/bootstrap/sass/_labels.scss +11 -9
  95. data/vendor/twitter/bootstrap/sass/_list-group.scss +22 -1
  96. data/vendor/twitter/bootstrap/sass/_mixins.scss +35 -943
  97. data/vendor/twitter/bootstrap/sass/_modals.scss +18 -7
  98. data/vendor/twitter/bootstrap/sass/_navbar.scss +41 -2
  99. data/vendor/twitter/bootstrap/sass/_navs.scss +1 -1
  100. data/vendor/twitter/bootstrap/sass/_normalize.scss +20 -18
  101. data/vendor/twitter/bootstrap/sass/_panels.scss +8 -6
  102. data/vendor/twitter/bootstrap/sass/_popovers.scss +1 -1
  103. data/vendor/twitter/bootstrap/sass/_progress-bars.scss +27 -2
  104. data/vendor/twitter/bootstrap/sass/_responsive-embed.scss +34 -0
  105. data/vendor/twitter/bootstrap/sass/_responsive-utilities.scss +101 -1
  106. data/vendor/twitter/bootstrap/sass/_scaffolding.scss +17 -1
  107. data/vendor/twitter/bootstrap/sass/_tables.scss +4 -4
  108. data/vendor/twitter/bootstrap/sass/_theme.scss +11 -0
  109. data/vendor/twitter/bootstrap/sass/_type.scss +32 -12
  110. data/vendor/twitter/bootstrap/sass/_utilities.scss +1 -0
  111. data/vendor/twitter/bootstrap/sass/_variables.scss +41 -24
  112. data/vendor/twitter/bootstrap/sass/bootstrap.scss +3 -2
  113. data/vendor/twitter/bootstrap/sass/mixins/_alerts.scss +14 -0
  114. data/vendor/twitter/bootstrap/sass/mixins/_background-variant.scss +11 -0
  115. data/vendor/twitter/bootstrap/sass/mixins/_border-radius.scss +18 -0
  116. data/vendor/twitter/bootstrap/sass/mixins/_buttons.scss +50 -0
  117. data/vendor/twitter/bootstrap/sass/mixins/_center-block.scss +7 -0
  118. data/vendor/twitter/bootstrap/sass/mixins/_clearfix.scss +22 -0
  119. data/vendor/twitter/bootstrap/sass/mixins/_forms.scss +84 -0
  120. data/vendor/twitter/bootstrap/sass/mixins/_gradients.scss +58 -0
  121. data/vendor/twitter/bootstrap/sass/mixins/_grid-framework.scss +81 -0
  122. data/vendor/twitter/bootstrap/sass/mixins/_grid.scss +122 -0
  123. data/vendor/twitter/bootstrap/sass/mixins/_hide-text.scss +21 -0
  124. data/vendor/twitter/bootstrap/sass/mixins/_image.scss +34 -0
  125. data/vendor/twitter/bootstrap/sass/mixins/_labels.scss +12 -0
  126. data/vendor/twitter/bootstrap/sass/mixins/_list-group.scss +31 -0
  127. data/vendor/twitter/bootstrap/sass/mixins/_nav-divider.scss +10 -0
  128. data/vendor/twitter/bootstrap/sass/mixins/_nav-vertical-align.scss +9 -0
  129. data/vendor/twitter/bootstrap/sass/mixins/_opacity.scss +8 -0
  130. data/vendor/twitter/bootstrap/sass/mixins/_pagination.scss +23 -0
  131. data/vendor/twitter/bootstrap/sass/mixins/_panels.scss +24 -0
  132. data/vendor/twitter/bootstrap/sass/mixins/_progress-bar.scss +10 -0
  133. data/vendor/twitter/bootstrap/sass/mixins/_reset-filter.scss +8 -0
  134. data/vendor/twitter/bootstrap/sass/mixins/_resize.scss +6 -0
  135. data/vendor/twitter/bootstrap/sass/mixins/_responsive-visibility.scss +21 -0
  136. data/vendor/twitter/bootstrap/sass/mixins/_size.scss +10 -0
  137. data/vendor/twitter/bootstrap/sass/mixins/_tab-focus.scss +9 -0
  138. data/vendor/twitter/bootstrap/sass/mixins/_table-row.scss +28 -0
  139. data/vendor/twitter/bootstrap/sass/mixins/_text-emphasis.scss +11 -0
  140. data/vendor/twitter/bootstrap/sass/mixins/_text-overflow.scss +8 -0
  141. data/vendor/twitter/bootstrap/sass/mixins/_vendor-prefixes.scss +219 -0
  142. metadata +62 -2
@@ -33,12 +33,13 @@
33
33
  }
34
34
  }
35
35
 
36
- // Dismissable alerts
36
+ // Dismissible alerts
37
37
  //
38
38
  // Expand the right padding and account for the close button's positioning.
39
39
 
40
- .alert-dismissable {
41
- padding-right: (@alert-padding + 20);
40
+ .alert-dismissable, // The misspelled .alert-dismissable was deprecated in 3.2.0.
41
+ .alert-dismissible {
42
+ padding-right: (@alert-padding + 20);
42
43
 
43
44
  // Adjust close link position
44
45
  .close {
@@ -3,7 +3,7 @@
3
3
  // --------------------------------------------------
4
4
 
5
5
 
6
- // Base classes
6
+ // Base class
7
7
  .badge {
8
8
  display: inline-block;
9
9
  min-width: 10px;
@@ -32,24 +32,24 @@
32
32
  top: 0;
33
33
  padding: 1px 5px;
34
34
  }
35
- }
36
35
 
37
- // Hover state, but only for links
38
- a.badge {
39
- &:hover,
40
- &:focus {
41
- color: @badge-link-hover-color;
42
- text-decoration: none;
43
- cursor: pointer;
36
+ // Hover state, but only for links
37
+ a& {
38
+ &:hover,
39
+ &:focus {
40
+ color: @badge-link-hover-color;
41
+ text-decoration: none;
42
+ cursor: pointer;
43
+ }
44
44
  }
45
- }
46
45
 
47
- // Account for counters in navs
48
- a.list-group-item.active > .badge,
49
- .nav-pills > .active > a > .badge {
50
- color: @badge-active-color;
51
- background-color: @badge-active-bg;
52
- }
53
- .nav-pills > li > a > .badge {
54
- margin-left: 3px;
46
+ // Account for badges in navs
47
+ a.list-group-item.active > &,
48
+ .nav-pills > .active > a > & {
49
+ color: @badge-active-color;
50
+ background-color: @badge-active-bg;
51
+ }
52
+ .nav-pills > li > a > & {
53
+ margin-left: 3px;
54
+ }
55
55
  }
@@ -2,9 +2,10 @@
2
2
  @import "variables.less";
3
3
  @import "mixins.less";
4
4
 
5
- // Reset
5
+ // Reset and dependencies
6
6
  @import "normalize.less";
7
7
  @import "print.less";
8
+ @import "glyphicons.less";
8
9
 
9
10
  // Core CSS
10
11
  @import "scaffolding.less";
@@ -17,7 +18,6 @@
17
18
 
18
19
  // Components
19
20
  @import "component-animations.less";
20
- @import "glyphicons.less";
21
21
  @import "dropdowns.less";
22
22
  @import "button-groups.less";
23
23
  @import "input-groups.less";
@@ -35,6 +35,7 @@
35
35
  @import "media.less";
36
36
  @import "list-group.less";
37
37
  @import "panels.less";
38
+ @import "responsive-embed.less";
38
39
  @import "wells.less";
39
40
  @import "close.less";
40
41
 
@@ -20,7 +20,7 @@
20
20
  }
21
21
  &:focus {
22
22
  // Remove focus outline when dropdown JS adds it after closing the menu
23
- outline: none;
23
+ outline: 0;
24
24
  }
25
25
  }
26
26
  }
@@ -216,11 +216,25 @@
216
216
  > .btn-group .btn {
217
217
  width: 100%;
218
218
  }
219
+
220
+ > .btn-group .dropdown-menu {
221
+ left: auto;
222
+ }
219
223
  }
220
224
 
221
225
 
222
226
  // Checkbox and radio options
227
+ //
228
+ // In order to support the browser's form validation feedback, powered by the
229
+ // `required` attribute, we have to "hide" the inputs via `opacity`. We cannot
230
+ // use `display: none;` or `visibility: hidden;` as that also hides the popover.
231
+ // This way, we ensure a DOM element is visible to position the popover from.
232
+ //
233
+ // See https://github.com/twbs/bootstrap/pull/12794 for more.
234
+
223
235
  [data-toggle="buttons"] > .btn > input[type="radio"],
224
236
  [data-toggle="buttons"] > .btn > input[type="checkbox"] {
225
- display: none;
237
+ position: absolute;
238
+ z-index: -1;
239
+ .opacity(0);
226
240
  }
@@ -140,8 +140,6 @@
140
140
  .btn-block {
141
141
  display: block;
142
142
  width: 100%;
143
- padding-left: 0;
144
- padding-right: 0;
145
143
  }
146
144
 
147
145
  // Vertically space out multiple block buttons
@@ -28,7 +28,9 @@
28
28
 
29
29
  > .active,
30
30
  > .next,
31
- > .prev { display: block; }
31
+ > .prev {
32
+ display: block;
33
+ }
32
34
 
33
35
  > .active {
34
36
  left: 0;
@@ -91,7 +93,7 @@
91
93
  // Hover/focus state
92
94
  &:hover,
93
95
  &:focus {
94
- outline: none;
96
+ outline: 0;
95
97
  color: @carousel-control-color;
96
98
  text-decoration: none;
97
99
  .opacity(.9);
@@ -110,20 +112,22 @@
110
112
  .icon-prev,
111
113
  .glyphicon-chevron-left {
112
114
  left: 50%;
115
+ margin-left: -10px;
113
116
  }
114
117
  .icon-next,
115
118
  .glyphicon-chevron-right {
116
119
  right: 50%;
120
+ margin-right: -10px;
117
121
  }
118
122
  .icon-prev,
119
123
  .icon-next {
120
124
  width: 20px;
121
125
  height: 20px;
122
126
  margin-top: -10px;
123
- margin-left: -10px;
124
127
  font-family: serif;
125
128
  }
126
129
 
130
+
127
131
  .icon-prev {
128
132
  &:before {
129
133
  content: '\2039';// SINGLE LEFT-POINTING ANGLE QUOTATION MARK (U+2039)
@@ -213,9 +217,16 @@
213
217
  width: 30px;
214
218
  height: 30px;
215
219
  margin-top: -15px;
216
- margin-left: -15px;
217
220
  font-size: 30px;
218
221
  }
222
+ .glyphicon-chevron-left,
223
+ .icon-prev {
224
+ margin-left: -15px;
225
+ }
226
+ .glyphicon-chevron-right,
227
+ .icon-next {
228
+ margin-right: -15px;
229
+ }
219
230
  }
220
231
 
221
232
  // Show and left align the captions
@@ -17,7 +17,6 @@ code {
17
17
  font-size: 90%;
18
18
  color: @code-color;
19
19
  background-color: @code-bg;
20
- white-space: nowrap;
21
20
  border-radius: @border-radius-base;
22
21
  }
23
22
 
@@ -29,6 +28,12 @@ kbd {
29
28
  background-color: @kbd-bg;
30
29
  border-radius: @border-radius-small;
31
30
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.25);
31
+
32
+ kbd {
33
+ padding: 0;
34
+ font-size: 100%;
35
+ box-shadow: none;
36
+ }
32
37
  }
33
38
 
34
39
  // Blocks of code
@@ -5,7 +5,7 @@
5
5
  // Heads up!
6
6
  //
7
7
  // We don't use the `.opacity()` mixin here since it causes a bug with text
8
- // fields in IE7-8. Source: https://github.com/twitter/bootstrap/pull/3552.
8
+ // fields in IE7-8. Source: https://github.com/twbs/bootstrap/pull/3552.
9
9
 
10
10
  .fade {
11
11
  opacity: 0;
@@ -17,10 +17,12 @@
17
17
 
18
18
  .collapse {
19
19
  display: none;
20
- &.in {
21
- display: block;
22
- }
20
+
21
+ &.in { display: block; }
22
+ tr&.in { display: table-row; }
23
+ tbody&.in { display: table-row-group; }
23
24
  }
25
+
24
26
  .collapsing {
25
27
  position: relative;
26
28
  height: 0;
@@ -38,6 +38,7 @@
38
38
  margin: 2px 0 0; // override default ul
39
39
  list-style: none;
40
40
  font-size: @font-size-base;
41
+ text-align: left; // Ensures proper alignment if parent has it changed (e.g., modal footer)
41
42
  background-color: @dropdown-bg;
42
43
  border: 1px solid @dropdown-fallback-border; // IE8 fallback
43
44
  border: 1px solid @dropdown-border;
@@ -154,6 +155,7 @@
154
155
  font-size: @font-size-small;
155
156
  line-height: @line-height-base;
156
157
  color: @dropdown-header-color;
158
+ white-space: nowrap; // as with > li > a
157
159
  }
158
160
 
159
161
  // Backdrop to catch body clicks on mobile, etc.
@@ -11,7 +11,7 @@ fieldset {
11
11
  padding: 0;
12
12
  margin: 0;
13
13
  border: 0;
14
- // Chrome and Firefox set a `min-width: -webkit-min-content;` on fieldsets,
14
+ // Chrome and Firefox set a `min-width: min-content;` on fieldsets,
15
15
  // so we reset that to ensure it behaves more like a standard block element.
16
16
  // See https://github.com/twbs/bootstrap/issues/12359.
17
17
  min-width: 0;
@@ -31,6 +31,7 @@ legend {
31
31
 
32
32
  label {
33
33
  display: inline-block;
34
+ max-width: 100%; // Force IE8 to wrap long content (see https://github.com/twbs/bootstrap/issues/13141)
34
35
  margin-bottom: 5px;
35
36
  font-weight: bold;
36
37
  }
@@ -51,7 +52,7 @@ input[type="search"] {
51
52
  input[type="radio"],
52
53
  input[type="checkbox"] {
53
54
  margin: 4px 0 0;
54
- margin-top: 1px \9; /* IE8-9 */
55
+ margin-top: 1px \9; // IE8-9
55
56
  line-height: normal;
56
57
  }
57
58
 
@@ -164,13 +165,28 @@ input[type="search"] {
164
165
  }
165
166
 
166
167
 
167
- // Special styles for iOS date input
168
+ // Special styles for iOS temporal inputs
168
169
  //
169
- // In Mobile Safari, date inputs require a pixel line-height that matches the
170
- // given height of the input.
171
-
172
- input[type="date"] {
170
+ // In Mobile Safari, setting `display: block` on temporal inputs causes the
171
+ // text within the input to become vertically misaligned.
172
+ // As a workaround, we set a pixel line-height that matches the
173
+ // given height of the input. Since this fucks up everything else, we have to
174
+ // appropriately reset it for Internet Explorer and the size variations.
175
+
176
+ input[type="date"],
177
+ input[type="time"],
178
+ input[type="datetime-local"],
179
+ input[type="month"] {
173
180
  line-height: @input-height-base;
181
+ // IE8+ misaligns the text within date inputs, so we reset
182
+ line-height: @line-height-base ~"\0";
183
+
184
+ &.input-sm {
185
+ line-height: @input-height-small;
186
+ }
187
+ &.input-lg {
188
+ line-height: @input-height-large;
189
+ }
174
190
  }
175
191
 
176
192
 
@@ -190,13 +206,15 @@ input[type="date"] {
190
206
 
191
207
  .radio,
192
208
  .checkbox {
209
+ position: relative;
193
210
  display: block;
194
211
  min-height: @line-height-computed; // clear the floating input if there is no label text
195
212
  margin-top: 10px;
196
213
  margin-bottom: 10px;
197
- padding-left: 20px;
214
+
198
215
  label {
199
- display: inline;
216
+ padding-left: 20px;
217
+ margin-bottom: 0;
200
218
  font-weight: normal;
201
219
  cursor: pointer;
202
220
  }
@@ -205,9 +223,11 @@ input[type="date"] {
205
223
  .radio-inline input[type="radio"],
206
224
  .checkbox input[type="checkbox"],
207
225
  .checkbox-inline input[type="checkbox"] {
208
- float: left;
226
+ position: absolute;
209
227
  margin-left: -20px;
228
+ margin-top: 4px \9;
210
229
  }
230
+
211
231
  .radio + .radio,
212
232
  .checkbox + .checkbox {
213
233
  margin-top: -5px; // Move up sibling radios or checkboxes for tighter spacing
@@ -230,19 +250,55 @@ input[type="date"] {
230
250
  }
231
251
 
232
252
  // Apply same disabled cursor tweak as for inputs
253
+ // Some special care is needed because <label>s don't inherit their parent's `cursor`.
233
254
  //
234
255
  // Note: Neither radios nor checkboxes can be readonly.
235
256
  input[type="radio"],
236
- input[type="checkbox"],
237
- .radio,
257
+ input[type="checkbox"] {
258
+ &[disabled],
259
+ &.disabled,
260
+ fieldset[disabled] & {
261
+ cursor: not-allowed;
262
+ }
263
+ }
264
+ // These classes are used directly on <label>s
238
265
  .radio-inline,
239
- .checkbox,
240
266
  .checkbox-inline {
241
- &[disabled],
267
+ &.disabled,
242
268
  fieldset[disabled] & {
243
269
  cursor: not-allowed;
244
270
  }
245
271
  }
272
+ // These classes are used on elements with <label> descendants
273
+ .radio,
274
+ .checkbox {
275
+ &.disabled,
276
+ fieldset[disabled] & {
277
+ label {
278
+ cursor: not-allowed;
279
+ }
280
+ }
281
+ }
282
+
283
+
284
+ // Static form control text
285
+ //
286
+ // Apply class to a `p` element to make any string of text align with labels in
287
+ // a horizontal form layout.
288
+
289
+ .form-control-static {
290
+ // Size it appropriately next to real form controls
291
+ padding-top: (@padding-base-vertical + 1);
292
+ padding-bottom: (@padding-base-vertical + 1);
293
+ // Remove default margin from `p`
294
+ margin-bottom: 0;
295
+
296
+ &.input-lg,
297
+ &.input-sm {
298
+ padding-left: 0;
299
+ padding-right: 0;
300
+ }
301
+ }
246
302
 
247
303
 
248
304
  // Form control sizing
@@ -271,18 +327,28 @@ input[type="checkbox"],
271
327
  .form-control {
272
328
  padding-right: (@input-height-base * 1.25);
273
329
  }
274
-
275
- // Feedback icon (requires .glyphicon classes)
276
- .form-control-feedback {
277
- position: absolute;
278
- top: (@line-height-computed + 5); // Height of the `label` and its margin
279
- right: 0;
280
- display: block;
281
- width: @input-height-base;
282
- height: @input-height-base;
283
- line-height: @input-height-base;
284
- text-align: center;
285
- }
330
+ }
331
+ // Feedback icon (requires .glyphicon classes)
332
+ .form-control-feedback {
333
+ position: absolute;
334
+ top: (@line-height-computed + 5); // Height of the `label` and its margin
335
+ right: 0;
336
+ z-index: 2; // Ensure icon is above input groups
337
+ display: block;
338
+ width: @input-height-base;
339
+ height: @input-height-base;
340
+ line-height: @input-height-base;
341
+ text-align: center;
342
+ }
343
+ .input-lg + .form-control-feedback {
344
+ width: @input-height-large;
345
+ height: @input-height-large;
346
+ line-height: @input-height-large;
347
+ }
348
+ .input-sm + .form-control-feedback {
349
+ width: @input-height-small;
350
+ height: @input-height-small;
351
+ line-height: @input-height-small;
286
352
  }
287
353
 
288
354
  // Feedback states
@@ -297,13 +363,9 @@ input[type="checkbox"],
297
363
  }
298
364
 
299
365
 
300
- // Static form control text
301
- //
302
- // Apply class to a `p` element to make any string of text align with labels in
303
- // a horizontal form layout.
304
-
305
- .form-control-static {
306
- margin-bottom: 0; // Remove default margin from `p`
366
+ // Reposition feedback icon if label is hidden with "screenreader only" state
367
+ .has-feedback label.sr-only ~ .form-control-feedback {
368
+ top: 0;
307
369
  }
308
370
 
309
371
 
@@ -349,6 +411,18 @@ input[type="checkbox"],
349
411
  width: auto; // Prevent labels from stacking above inputs in `.form-group`
350
412
  vertical-align: middle;
351
413
  }
414
+
415
+ .input-group {
416
+ display: inline-table;
417
+ vertical-align: middle;
418
+
419
+ .input-group-addon,
420
+ .input-group-btn,
421
+ .form-control {
422
+ width: auto;
423
+ }
424
+ }
425
+
352
426
  // Input groups need that 100% width though
353
427
  .input-group > .form-control {
354
428
  width: 100%;
@@ -367,12 +441,15 @@ input[type="checkbox"],
367
441
  display: inline-block;
368
442
  margin-top: 0;
369
443
  margin-bottom: 0;
370
- padding-left: 0;
371
444
  vertical-align: middle;
445
+
446
+ label {
447
+ padding-left: 0;
448
+ }
372
449
  }
373
450
  .radio input[type="radio"],
374
451
  .checkbox input[type="checkbox"] {
375
- float: none;
452
+ position: relative;
376
453
  margin-left: 0;
377
454
  }
378
455
 
@@ -394,8 +471,9 @@ input[type="checkbox"],
394
471
 
395
472
  .form-horizontal {
396
473
 
397
- // Consistent vertical alignment of labels, radios, and checkboxes
398
- .control-label,
474
+ // Consistent vertical alignment of radios and checkboxes
475
+ //
476
+ // Labels also get some reset styles, but that is scoped to a media query below.
399
477
  .radio,
400
478
  .checkbox,
401
479
  .radio-inline,
@@ -416,14 +494,13 @@ input[type="checkbox"],
416
494
  .make-row();
417
495
  }
418
496
 
419
- .form-control-static {
420
- padding-top: (@padding-base-vertical + 1);
421
- }
422
-
423
- // Only right align form labels here when the columns stop stacking
497
+ // Reset spacing and right align labels, but scope to media queries so that
498
+ // labels on narrow viewports stack the same as a default form example.
424
499
  @media (min-width: @screen-sm-min) {
425
500
  .control-label {
426
501
  text-align: right;
502
+ margin-bottom: 0;
503
+ padding-top: (@padding-base-vertical + 1); // Default padding plus a border
427
504
  }
428
505
  }
429
506
 
@@ -435,4 +512,29 @@ input[type="checkbox"],
435
512
  top: 0;
436
513
  right: (@grid-gutter-width / 2);
437
514
  }
515
+
516
+ // Form group sizes
517
+ //
518
+ // Quick utility class for applying `.input-lg` and `.input-sm` styles to the
519
+ // inputs and labels within a `.form-group`.
520
+ .form-group-lg {
521
+ @media (min-width: @screen-sm-min) {
522
+ .control-label {
523
+ padding-top: ((@padding-large-vertical * @line-height-large) + 1);
524
+ }
525
+ }
526
+ .form-control {
527
+ &:extend(.input-lg);
528
+ }
529
+ }
530
+ .form-group-sm {
531
+ @media (min-width: @screen-sm-min) {
532
+ .control-label {
533
+ padding-top: (@padding-small-vertical + 1);
534
+ }
535
+ }
536
+ .form-control {
537
+ &:extend(.input-sm);
538
+ }
539
+ }
438
540
  }