twitter-bootswatch-rails 3.1.1.1 → 3.2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/twitter/bootstrap/affix.js +19 -14
  3. data/app/assets/javascripts/twitter/bootstrap/alert.js +10 -6
  4. data/app/assets/javascripts/twitter/bootstrap/button.js +11 -8
  5. data/app/assets/javascripts/twitter/bootstrap/carousel.js +49 -31
  6. data/app/assets/javascripts/twitter/bootstrap/collapse.js +22 -22
  7. data/app/assets/javascripts/twitter/bootstrap/dropdown.js +17 -13
  8. data/app/assets/javascripts/twitter/bootstrap/modal.js +66 -29
  9. data/app/assets/javascripts/twitter/bootstrap/popover.js +10 -7
  10. data/app/assets/javascripts/twitter/bootstrap/scrollspy.js +40 -23
  11. data/app/assets/javascripts/twitter/bootstrap/tab.js +11 -8
  12. data/app/assets/javascripts/twitter/bootstrap/tooltip.js +115 -57
  13. data/app/assets/javascripts/twitter/bootstrap/transition.js +18 -7
  14. data/lib/generators/bootswatch/install/install_generator.rb +16 -5
  15. data/lib/generators/bootswatch/install/templates/bootstrap.less +3 -2
  16. data/lib/generators/bootswatch/install/templates/mixins.less.tt +35 -925
  17. data/lib/generators/bootswatch/install/templates/variables.less.tt +40 -23
  18. data/lib/twitter/bootswatch/rails/version.rb +1 -1
  19. data/vendor/toolkit/twitter/bootstrap/alerts.less +4 -3
  20. data/vendor/toolkit/twitter/bootstrap/badges.less +18 -18
  21. data/vendor/toolkit/twitter/bootstrap/bootstrap.less +3 -2
  22. data/vendor/toolkit/twitter/bootstrap/button-groups.less +16 -2
  23. data/vendor/toolkit/twitter/bootstrap/buttons.less +0 -2
  24. data/vendor/toolkit/twitter/bootstrap/carousel.less +15 -4
  25. data/vendor/toolkit/twitter/bootstrap/code.less +6 -1
  26. data/vendor/toolkit/twitter/bootstrap/component-animations.less +6 -4
  27. data/vendor/toolkit/twitter/bootstrap/dropdowns.less +2 -0
  28. data/vendor/toolkit/twitter/bootstrap/forms.less +144 -42
  29. data/vendor/toolkit/twitter/bootstrap/input-groups.less +6 -2
  30. data/vendor/toolkit/twitter/bootstrap/jumbotron.less +4 -0
  31. data/vendor/toolkit/twitter/bootstrap/labels.less +1 -1
  32. data/vendor/toolkit/twitter/bootstrap/list-group.less +22 -1
  33. data/vendor/toolkit/twitter/bootstrap/mixins.less +35 -925
  34. data/vendor/toolkit/twitter/bootstrap/mixins/alerts.less +14 -0
  35. data/vendor/toolkit/twitter/bootstrap/mixins/background-variant.less +8 -0
  36. data/vendor/toolkit/twitter/bootstrap/mixins/border-radius.less +18 -0
  37. data/vendor/toolkit/twitter/bootstrap/mixins/buttons.less +50 -0
  38. data/vendor/toolkit/twitter/bootstrap/mixins/center-block.less +7 -0
  39. data/vendor/toolkit/twitter/bootstrap/mixins/clearfix.less +22 -0
  40. data/vendor/toolkit/twitter/bootstrap/mixins/forms.less +81 -0
  41. data/vendor/toolkit/twitter/bootstrap/mixins/gradients.less +59 -0
  42. data/vendor/toolkit/twitter/bootstrap/mixins/grid-framework.less +91 -0
  43. data/vendor/toolkit/twitter/bootstrap/mixins/grid.less +122 -0
  44. data/vendor/toolkit/twitter/bootstrap/mixins/hide-text.less +21 -0
  45. data/vendor/toolkit/twitter/bootstrap/mixins/image.less +34 -0
  46. data/vendor/toolkit/twitter/bootstrap/mixins/labels.less +12 -0
  47. data/vendor/toolkit/twitter/bootstrap/mixins/list-group.less +29 -0
  48. data/vendor/toolkit/twitter/bootstrap/mixins/nav-divider.less +10 -0
  49. data/vendor/toolkit/twitter/bootstrap/mixins/nav-vertical-align.less +9 -0
  50. data/vendor/toolkit/twitter/bootstrap/mixins/opacity.less +8 -0
  51. data/vendor/toolkit/twitter/bootstrap/mixins/pagination.less +23 -0
  52. data/vendor/toolkit/twitter/bootstrap/mixins/panels.less +24 -0
  53. data/vendor/toolkit/twitter/bootstrap/mixins/progress-bar.less +10 -0
  54. data/vendor/toolkit/twitter/bootstrap/mixins/reset-filter.less +8 -0
  55. data/vendor/toolkit/twitter/bootstrap/mixins/resize.less +6 -0
  56. data/vendor/toolkit/twitter/bootstrap/mixins/responsive-visibility.less +15 -0
  57. data/vendor/toolkit/twitter/bootstrap/mixins/size.less +10 -0
  58. data/vendor/toolkit/twitter/bootstrap/mixins/tab-focus.less +9 -0
  59. data/vendor/toolkit/twitter/bootstrap/mixins/table-row.less +28 -0
  60. data/vendor/toolkit/twitter/bootstrap/mixins/text-emphasis.less +8 -0
  61. data/vendor/toolkit/twitter/bootstrap/mixins/text-overflow.less +8 -0
  62. data/vendor/toolkit/twitter/bootstrap/mixins/vendor-prefixes.less +224 -0
  63. data/vendor/toolkit/twitter/bootstrap/modals.less +18 -7
  64. data/vendor/toolkit/twitter/bootstrap/navbar.less +41 -2
  65. data/vendor/toolkit/twitter/bootstrap/navs.less +1 -1
  66. data/vendor/toolkit/twitter/bootstrap/normalize.less +21 -19
  67. data/vendor/toolkit/twitter/bootstrap/panels.less +8 -6
  68. data/vendor/toolkit/twitter/bootstrap/popovers.less +1 -1
  69. data/vendor/toolkit/twitter/bootstrap/progress-bars.less +27 -2
  70. data/vendor/toolkit/twitter/bootstrap/responsive-embed.less +34 -0
  71. data/vendor/toolkit/twitter/bootstrap/responsive-utilities.less +103 -1
  72. data/vendor/toolkit/twitter/bootstrap/scaffolding.less +17 -1
  73. data/vendor/toolkit/twitter/bootstrap/tables.less +4 -4
  74. data/vendor/toolkit/twitter/bootstrap/theme.less +11 -0
  75. data/vendor/toolkit/twitter/bootstrap/type.less +32 -12
  76. data/vendor/toolkit/twitter/bootstrap/utilities.less +1 -0
  77. data/vendor/toolkit/twitter/bootstrap/variables.less +40 -23
  78. metadata +35 -5
@@ -13,7 +13,7 @@
13
13
  @gray-darker: lighten(#000, 13.5%); // #222
14
14
  @gray-dark: lighten(#000, 20%); // #333
15
15
  @gray: lighten(#000, 33.5%); // #555
16
- @gray-light: lighten(#000, 60%); // #999
16
+ @gray-light: lighten(#000, 46.7%); // #777
17
17
  @gray-lighter: lighten(#000, 93.5%); // #eee
18
18
 
19
19
  @brand-primary: #428bca;
@@ -25,7 +25,7 @@
25
25
 
26
26
  //== Scaffolding
27
27
  //
28
- // ## Settings for some of the most global styles.
28
+ //## Settings for some of the most global styles.
29
29
 
30
30
  //** Background color for `<body>`.
31
31
  @body-bg: #fff;
@@ -71,14 +71,18 @@
71
71
  @headings-color: inherit;
72
72
 
73
73
 
74
- //-- Iconography
74
+ //== Iconography
75
75
  //
76
- //## Specify custom locations of the include Glyphicons icon font. Useful for those including Bootstrap via Bower.
76
+ //## Specify custom location and filename of the included Glyphicons icon font. Useful for those including Bootstrap via Bower.
77
77
 
78
+ //** Load fonts from this directory.
78
79
  @icon-font-path: "twitter/bootstrap/";
80
+ //** File name for all font files.
79
81
  @icon-font-name: "glyphicons-halflings-regular";
82
+ //** Element ID within SVG icon file.
80
83
  @icon-font-svg-id: "glyphicons_halflingsregular";
81
84
 
85
+
82
86
  //== Components
83
87
  //
84
88
  //## Define common padding and border radius sizes and more. Values based on 14px text and 1.428 line-height (~20px to start).
@@ -235,7 +239,7 @@
235
239
  //** Text color for headers within dropdown menus.
236
240
  @dropdown-header-color: @gray-light;
237
241
 
238
- // Note: Deprecated @dropdown-caret-color as of v3.1.0
242
+ //** Deprecated `@dropdown-caret-color` as of v3.1.0
239
243
  @dropdown-caret-color: #000;
240
244
 
241
245
 
@@ -248,8 +252,8 @@
248
252
 
249
253
  @zindex-navbar: 1000;
250
254
  @zindex-dropdown: 1000;
251
- @zindex-popover: 1010;
252
- @zindex-tooltip: 1030;
255
+ @zindex-popover: 1060;
256
+ @zindex-tooltip: 1070;
253
257
  @zindex-navbar-fixed: 1030;
254
258
  @zindex-modal-background: 1040;
255
259
  @zindex-modal: 1050;
@@ -260,27 +264,32 @@
260
264
  //## Define the breakpoints at which your layout will change, adapting to different screen sizes.
261
265
 
262
266
  // Extra small screen / phone
263
- // Note: Deprecated @screen-xs and @screen-phone as of v3.0.1
267
+ //** Deprecated `@screen-xs` as of v3.0.1
264
268
  @screen-xs: 480px;
269
+ //** Deprecated `@screen-xs-min` as of v3.2.0
265
270
  @screen-xs-min: @screen-xs;
271
+ //** Deprecated `@screen-phone` as of v3.0.1
266
272
  @screen-phone: @screen-xs-min;
267
273
 
268
274
  // Small screen / tablet
269
- // Note: Deprecated @screen-sm and @screen-tablet as of v3.0.1
275
+ //** Deprecated `@screen-sm` as of v3.0.1
270
276
  @screen-sm: 768px;
271
277
  @screen-sm-min: @screen-sm;
278
+ //** Deprecated `@screen-tablet` as of v3.0.1
272
279
  @screen-tablet: @screen-sm-min;
273
280
 
274
281
  // Medium screen / desktop
275
- // Note: Deprecated @screen-md and @screen-desktop as of v3.0.1
282
+ //** Deprecated `@screen-md` as of v3.0.1
276
283
  @screen-md: 992px;
277
284
  @screen-md-min: @screen-md;
285
+ //** Deprecated `@screen-desktop` as of v3.0.1
278
286
  @screen-desktop: @screen-md-min;
279
287
 
280
288
  // Large screen / wide desktop
281
- // Note: Deprecated @screen-lg and @screen-lg-desktop as of v3.0.1
289
+ //** Deprecated `@screen-lg` as of v3.0.1
282
290
  @screen-lg: 1200px;
283
291
  @screen-lg-min: @screen-lg;
292
+ //** Deprecated `@screen-lg-desktop` as of v3.0.1
284
293
  @screen-lg-desktop: @screen-lg-min;
285
294
 
286
295
  // So media queries don't overlap when required, provide a maximum
@@ -561,7 +570,7 @@
561
570
  //##
562
571
 
563
572
  //** Padding applied to the modal body
564
- @modal-inner-padding: 20px;
573
+ @modal-inner-padding: 15px;
565
574
 
566
575
  //** Padding applied to the modal title
567
576
  @modal-title-padding: 15px;
@@ -646,17 +655,26 @@
646
655
  //** List group border radius
647
656
  @list-group-border-radius: @border-radius-base;
648
657
 
649
- //** Background color of single list elements on hover
658
+ //** Background color of single list items on hover
650
659
  @list-group-hover-bg: #f5f5f5;
651
- //** Text color of active list elements
660
+ //** Text color of active list items
652
661
  @list-group-active-color: @component-active-color;
653
- //** Background color of active list elements
662
+ //** Background color of active list items
654
663
  @list-group-active-bg: @component-active-bg;
655
664
  //** Border color of active list elements
656
665
  @list-group-active-border: @list-group-active-bg;
666
+ //** Text color for content within active list items
657
667
  @list-group-active-text-color: lighten(@list-group-active-bg, 40%);
658
668
 
669
+ //** Text color of disabled list items
670
+ @list-group-disabled-color: @gray-light;
671
+ //** Background color of disabled list items
672
+ @list-group-disabled-bg: @gray-lighter;
673
+ //** Text color for content within disabled list items
674
+ @list-group-disabled-text-color: @list-group-disabled-color;
675
+
659
676
  @list-group-link-color: #555;
677
+ @list-group-link-hover-color: @list-group-link-color;
660
678
  @list-group-link-heading-color: #333;
661
679
 
662
680
 
@@ -666,6 +684,8 @@
666
684
 
667
685
  @panel-bg: #fff;
668
686
  @panel-body-padding: 15px;
687
+ @panel-heading-padding: 10px 15px;
688
+ @panel-footer-padding: @panel-heading-padding;
669
689
  @panel-border-radius: @border-radius-base;
670
690
 
671
691
  //** Border color for elements within panels
@@ -805,6 +825,8 @@
805
825
  //
806
826
  //##
807
827
 
828
+ //** Horizontal offset for forms and lists.
829
+ @component-offset-horizontal: 180px;
808
830
  //** Text muted color
809
831
  @text-muted: @gray-light;
810
832
  //** Abbreviations and acronyms border color
@@ -819,14 +841,9 @@
819
841
  @blockquote-border-color: @gray-lighter;
820
842
  //** Page header border color
821
843
  @page-header-border-color: @gray-lighter;
822
-
823
-
824
- //== Miscellaneous
825
- //
826
- //##
827
-
844
+ //** Width of horizontal description list titles
845
+ @dl-horizontal-offset: @component-offset-horizontal;
828
846
  //** Horizontal line color.
829
847
  @hr-border: @gray-lighter;
830
848
 
831
- //** Horizontal offset for forms and lists.
832
- @component-offset-horizontal: 180px;
849
+
@@ -1,7 +1,7 @@
1
1
  module Twitter
2
2
  module Bootswatch
3
3
  module Rails
4
- VERSION = '3.1.1.1'
4
+ VERSION = '3.2.0.0'
5
5
  end
6
6
  end
7
7
  end
@@ -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
  }