less-rails-bootstrap 3.1.1.1 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -1
  3. data/.travis.yml +5 -4
  4. data/Appraisals +10 -4
  5. data/Gemfile +0 -2
  6. data/ISSUES.md +6 -0
  7. data/README.md +6 -6
  8. data/app/assets/fonts/twitter/bootstrap/glyphicons-halflings-regular.eot +0 -0
  9. data/app/assets/fonts/twitter/bootstrap/glyphicons-halflings-regular.svg +229 -0
  10. data/app/assets/fonts/twitter/bootstrap/glyphicons-halflings-regular.ttf +0 -0
  11. data/app/assets/fonts/twitter/bootstrap/glyphicons-halflings-regular.woff +0 -0
  12. data/app/assets/javascripts/twitter/bootstrap.js +12 -0
  13. data/app/assets/javascripts/twitter/bootstrap/affix.js +142 -0
  14. data/app/assets/javascripts/twitter/bootstrap/alert.js +92 -0
  15. data/app/assets/javascripts/twitter/bootstrap/button.js +110 -0
  16. data/app/assets/javascripts/twitter/bootstrap/carousel.js +223 -0
  17. data/app/assets/javascripts/twitter/bootstrap/collapse.js +170 -0
  18. data/app/assets/javascripts/twitter/bootstrap/dropdown.js +151 -0
  19. data/app/assets/javascripts/twitter/bootstrap/modal.js +280 -0
  20. data/app/assets/javascripts/twitter/bootstrap/popover.js +113 -0
  21. data/app/assets/javascripts/twitter/bootstrap/scrollspy.js +170 -0
  22. data/app/assets/javascripts/twitter/bootstrap/tab.js +128 -0
  23. data/app/assets/javascripts/twitter/bootstrap/tooltip.js +457 -0
  24. data/app/assets/javascripts/twitter/bootstrap/transition.js +59 -0
  25. data/app/assets/stylesheets/twitter/bootstrap.less +1 -0
  26. data/app/frameworks/twitter/bootstrap/alerts.less +68 -0
  27. data/app/frameworks/twitter/bootstrap/badges.less +55 -0
  28. data/app/frameworks/twitter/bootstrap/bootstrap.less +50 -0
  29. data/app/frameworks/twitter/bootstrap/breadcrumbs.less +26 -0
  30. data/app/frameworks/twitter/bootstrap/button-groups.less +240 -0
  31. data/app/frameworks/twitter/bootstrap/buttons.less +157 -0
  32. data/app/frameworks/twitter/bootstrap/carousel.less +243 -0
  33. data/app/frameworks/twitter/bootstrap/close.less +33 -0
  34. data/app/frameworks/twitter/bootstrap/code.less +68 -0
  35. data/app/frameworks/twitter/bootstrap/component-animations.less +31 -0
  36. data/app/frameworks/twitter/bootstrap/dropdowns.less +215 -0
  37. data/app/frameworks/twitter/bootstrap/forms.less +540 -0
  38. data/app/frameworks/twitter/bootstrap/glyphicons.less +233 -0
  39. data/app/frameworks/twitter/bootstrap/grid.less +84 -0
  40. data/app/frameworks/twitter/bootstrap/input-groups.less +166 -0
  41. data/app/frameworks/twitter/bootstrap/jumbotron.less +48 -0
  42. data/app/frameworks/twitter/bootstrap/labels.less +64 -0
  43. data/app/frameworks/twitter/bootstrap/list-group.less +131 -0
  44. data/app/frameworks/twitter/bootstrap/media.less +56 -0
  45. data/app/frameworks/twitter/bootstrap/mixins.less +39 -0
  46. data/app/frameworks/twitter/bootstrap/mixins/alerts.less +14 -0
  47. data/app/frameworks/twitter/bootstrap/mixins/background-variant.less +8 -0
  48. data/app/frameworks/twitter/bootstrap/mixins/border-radius.less +18 -0
  49. data/app/frameworks/twitter/bootstrap/mixins/buttons.less +50 -0
  50. data/app/frameworks/twitter/bootstrap/mixins/center-block.less +7 -0
  51. data/app/frameworks/twitter/bootstrap/mixins/clearfix.less +22 -0
  52. data/app/frameworks/twitter/bootstrap/mixins/forms.less +81 -0
  53. data/app/frameworks/twitter/bootstrap/mixins/gradients.less +59 -0
  54. data/app/frameworks/twitter/bootstrap/mixins/grid-framework.less +91 -0
  55. data/app/frameworks/twitter/bootstrap/mixins/grid.less +122 -0
  56. data/app/frameworks/twitter/bootstrap/mixins/hide-text.less +21 -0
  57. data/app/frameworks/twitter/bootstrap/mixins/image.less +34 -0
  58. data/app/frameworks/twitter/bootstrap/mixins/labels.less +12 -0
  59. data/app/frameworks/twitter/bootstrap/mixins/list-group.less +29 -0
  60. data/app/frameworks/twitter/bootstrap/mixins/nav-divider.less +10 -0
  61. data/app/frameworks/twitter/bootstrap/mixins/nav-vertical-align.less +9 -0
  62. data/app/frameworks/twitter/bootstrap/mixins/opacity.less +8 -0
  63. data/app/frameworks/twitter/bootstrap/mixins/pagination.less +23 -0
  64. data/app/frameworks/twitter/bootstrap/mixins/panels.less +24 -0
  65. data/app/frameworks/twitter/bootstrap/mixins/progress-bar.less +10 -0
  66. data/app/frameworks/twitter/bootstrap/mixins/reset-filter.less +8 -0
  67. data/app/frameworks/twitter/bootstrap/mixins/resize.less +6 -0
  68. data/app/frameworks/twitter/bootstrap/mixins/responsive-visibility.less +15 -0
  69. data/app/frameworks/twitter/bootstrap/mixins/size.less +10 -0
  70. data/app/frameworks/twitter/bootstrap/mixins/tab-focus.less +9 -0
  71. data/app/frameworks/twitter/bootstrap/mixins/table-row.less +28 -0
  72. data/app/frameworks/twitter/bootstrap/mixins/text-emphasis.less +8 -0
  73. data/app/frameworks/twitter/bootstrap/mixins/text-overflow.less +8 -0
  74. data/app/frameworks/twitter/bootstrap/mixins/vendor-prefixes.less +224 -0
  75. data/app/frameworks/twitter/bootstrap/modals.less +150 -0
  76. data/app/frameworks/twitter/bootstrap/navbar.less +655 -0
  77. data/app/frameworks/twitter/bootstrap/navs.less +242 -0
  78. data/app/frameworks/twitter/bootstrap/normalize.less +425 -0
  79. data/app/frameworks/twitter/bootstrap/pager.less +55 -0
  80. data/app/frameworks/twitter/bootstrap/pagination.less +88 -0
  81. data/app/frameworks/twitter/bootstrap/panels.less +243 -0
  82. data/app/frameworks/twitter/bootstrap/popovers.less +133 -0
  83. data/app/frameworks/twitter/bootstrap/print.less +101 -0
  84. data/app/frameworks/twitter/bootstrap/progress-bars.less +105 -0
  85. data/app/frameworks/twitter/bootstrap/responsive-embed.less +34 -0
  86. data/app/frameworks/twitter/bootstrap/responsive-utilities.less +194 -0
  87. data/app/frameworks/twitter/bootstrap/scaffolding.less +150 -0
  88. data/app/frameworks/twitter/bootstrap/tables.less +233 -0
  89. data/app/frameworks/twitter/bootstrap/theme.less +258 -0
  90. data/app/frameworks/twitter/bootstrap/thumbnails.less +36 -0
  91. data/app/frameworks/twitter/bootstrap/tooltip.less +95 -0
  92. data/app/frameworks/twitter/bootstrap/type.less +313 -0
  93. data/app/frameworks/twitter/bootstrap/utilities.less +57 -0
  94. data/app/frameworks/twitter/bootstrap/variables.less +846 -0
  95. data/app/frameworks/twitter/bootstrap/wells.less +29 -0
  96. data/less-rails-bootstrap.gemspec +4 -2
  97. data/lib/less/rails/bootstrap/version.rb +1 -1
  98. data/scripts/update_bootstrap.sh +5 -4
  99. data/test/cases/generators/custom_bootstrap_generator_test.rb +1 -1
  100. metadata +51 -7
@@ -0,0 +1,31 @@
1
+ //
2
+ // Component animations
3
+ // --------------------------------------------------
4
+
5
+ // Heads up!
6
+ //
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/twbs/bootstrap/pull/3552.
9
+
10
+ .fade {
11
+ opacity: 0;
12
+ .transition(opacity .15s linear);
13
+ &.in {
14
+ opacity: 1;
15
+ }
16
+ }
17
+
18
+ .collapse {
19
+ display: none;
20
+
21
+ &.in { display: block; }
22
+ tr&.in { display: table-row; }
23
+ tbody&.in { display: table-row-group; }
24
+ }
25
+
26
+ .collapsing {
27
+ position: relative;
28
+ height: 0;
29
+ overflow: hidden;
30
+ .transition(height .35s ease);
31
+ }
@@ -0,0 +1,215 @@
1
+ //
2
+ // Dropdown menus
3
+ // --------------------------------------------------
4
+
5
+
6
+ // Dropdown arrow/caret
7
+ .caret {
8
+ display: inline-block;
9
+ width: 0;
10
+ height: 0;
11
+ margin-left: 2px;
12
+ vertical-align: middle;
13
+ border-top: @caret-width-base solid;
14
+ border-right: @caret-width-base solid transparent;
15
+ border-left: @caret-width-base solid transparent;
16
+ }
17
+
18
+ // The dropdown wrapper (div)
19
+ .dropdown {
20
+ position: relative;
21
+ }
22
+
23
+ // Prevent the focus on the dropdown toggle when closing dropdowns
24
+ .dropdown-toggle:focus {
25
+ outline: 0;
26
+ }
27
+
28
+ // The dropdown menu (ul)
29
+ .dropdown-menu {
30
+ position: absolute;
31
+ top: 100%;
32
+ left: 0;
33
+ z-index: @zindex-dropdown;
34
+ display: none; // none by default, but block on "open" of the menu
35
+ float: left;
36
+ min-width: 160px;
37
+ padding: 5px 0;
38
+ margin: 2px 0 0; // override default ul
39
+ list-style: none;
40
+ font-size: @font-size-base;
41
+ text-align: left; // Ensures proper alignment if parent has it changed (e.g., modal footer)
42
+ background-color: @dropdown-bg;
43
+ border: 1px solid @dropdown-fallback-border; // IE8 fallback
44
+ border: 1px solid @dropdown-border;
45
+ border-radius: @border-radius-base;
46
+ .box-shadow(0 6px 12px rgba(0,0,0,.175));
47
+ background-clip: padding-box;
48
+
49
+ // Aligns the dropdown menu to right
50
+ //
51
+ // Deprecated as of 3.1.0 in favor of `.dropdown-menu-[dir]`
52
+ &.pull-right {
53
+ right: 0;
54
+ left: auto;
55
+ }
56
+
57
+ // Dividers (basically an hr) within the dropdown
58
+ .divider {
59
+ .nav-divider(@dropdown-divider-bg);
60
+ }
61
+
62
+ // Links within the dropdown menu
63
+ > li > a {
64
+ display: block;
65
+ padding: 3px 20px;
66
+ clear: both;
67
+ font-weight: normal;
68
+ line-height: @line-height-base;
69
+ color: @dropdown-link-color;
70
+ white-space: nowrap; // prevent links from randomly breaking onto new lines
71
+ }
72
+ }
73
+
74
+ // Hover/Focus state
75
+ .dropdown-menu > li > a {
76
+ &:hover,
77
+ &:focus {
78
+ text-decoration: none;
79
+ color: @dropdown-link-hover-color;
80
+ background-color: @dropdown-link-hover-bg;
81
+ }
82
+ }
83
+
84
+ // Active state
85
+ .dropdown-menu > .active > a {
86
+ &,
87
+ &:hover,
88
+ &:focus {
89
+ color: @dropdown-link-active-color;
90
+ text-decoration: none;
91
+ outline: 0;
92
+ background-color: @dropdown-link-active-bg;
93
+ }
94
+ }
95
+
96
+ // Disabled state
97
+ //
98
+ // Gray out text and ensure the hover/focus state remains gray
99
+
100
+ .dropdown-menu > .disabled > a {
101
+ &,
102
+ &:hover,
103
+ &:focus {
104
+ color: @dropdown-link-disabled-color;
105
+ }
106
+ }
107
+ // Nuke hover/focus effects
108
+ .dropdown-menu > .disabled > a {
109
+ &:hover,
110
+ &:focus {
111
+ text-decoration: none;
112
+ background-color: transparent;
113
+ background-image: none; // Remove CSS gradient
114
+ .reset-filter();
115
+ cursor: not-allowed;
116
+ }
117
+ }
118
+
119
+ // Open state for the dropdown
120
+ .open {
121
+ // Show the menu
122
+ > .dropdown-menu {
123
+ display: block;
124
+ }
125
+
126
+ // Remove the outline when :focus is triggered
127
+ > a {
128
+ outline: 0;
129
+ }
130
+ }
131
+
132
+ // Menu positioning
133
+ //
134
+ // Add extra class to `.dropdown-menu` to flip the alignment of the dropdown
135
+ // menu with the parent.
136
+ .dropdown-menu-right {
137
+ left: auto; // Reset the default from `.dropdown-menu`
138
+ right: 0;
139
+ }
140
+ // With v3, we enabled auto-flipping if you have a dropdown within a right
141
+ // aligned nav component. To enable the undoing of that, we provide an override
142
+ // to restore the default dropdown menu alignment.
143
+ //
144
+ // This is only for left-aligning a dropdown menu within a `.navbar-right` or
145
+ // `.pull-right` nav component.
146
+ .dropdown-menu-left {
147
+ left: 0;
148
+ right: auto;
149
+ }
150
+
151
+ // Dropdown section headers
152
+ .dropdown-header {
153
+ display: block;
154
+ padding: 3px 20px;
155
+ font-size: @font-size-small;
156
+ line-height: @line-height-base;
157
+ color: @dropdown-header-color;
158
+ white-space: nowrap; // as with > li > a
159
+ }
160
+
161
+ // Backdrop to catch body clicks on mobile, etc.
162
+ .dropdown-backdrop {
163
+ position: fixed;
164
+ left: 0;
165
+ right: 0;
166
+ bottom: 0;
167
+ top: 0;
168
+ z-index: (@zindex-dropdown - 10);
169
+ }
170
+
171
+ // Right aligned dropdowns
172
+ .pull-right > .dropdown-menu {
173
+ right: 0;
174
+ left: auto;
175
+ }
176
+
177
+ // Allow for dropdowns to go bottom up (aka, dropup-menu)
178
+ //
179
+ // Just add .dropup after the standard .dropdown class and you're set, bro.
180
+ // TODO: abstract this so that the navbar fixed styles are not placed here?
181
+
182
+ .dropup,
183
+ .navbar-fixed-bottom .dropdown {
184
+ // Reverse the caret
185
+ .caret {
186
+ border-top: 0;
187
+ border-bottom: @caret-width-base solid;
188
+ content: "";
189
+ }
190
+ // Different positioning for bottom up menu
191
+ .dropdown-menu {
192
+ top: auto;
193
+ bottom: 100%;
194
+ margin-bottom: 1px;
195
+ }
196
+ }
197
+
198
+
199
+ // Component alignment
200
+ //
201
+ // Reiterate per navbar.less and the modified component alignment there.
202
+
203
+ @media (min-width: @grid-float-breakpoint) {
204
+ .navbar-right {
205
+ .dropdown-menu {
206
+ .dropdown-menu-right();
207
+ }
208
+ // Necessary for overrides of the default right aligned menu.
209
+ // Will remove come v4 in all likelihood.
210
+ .dropdown-menu-left {
211
+ .dropdown-menu-left();
212
+ }
213
+ }
214
+ }
215
+
@@ -0,0 +1,540 @@
1
+ //
2
+ // Forms
3
+ // --------------------------------------------------
4
+
5
+
6
+ // Normalize non-controls
7
+ //
8
+ // Restyle and baseline non-control form elements.
9
+
10
+ fieldset {
11
+ padding: 0;
12
+ margin: 0;
13
+ border: 0;
14
+ // Chrome and Firefox set a `min-width: min-content;` on fieldsets,
15
+ // so we reset that to ensure it behaves more like a standard block element.
16
+ // See https://github.com/twbs/bootstrap/issues/12359.
17
+ min-width: 0;
18
+ }
19
+
20
+ legend {
21
+ display: block;
22
+ width: 100%;
23
+ padding: 0;
24
+ margin-bottom: @line-height-computed;
25
+ font-size: (@font-size-base * 1.5);
26
+ line-height: inherit;
27
+ color: @legend-color;
28
+ border: 0;
29
+ border-bottom: 1px solid @legend-border-color;
30
+ }
31
+
32
+ label {
33
+ display: inline-block;
34
+ max-width: 100%; // Force IE8 to wrap long content (see https://github.com/twbs/bootstrap/issues/13141)
35
+ margin-bottom: 5px;
36
+ font-weight: bold;
37
+ }
38
+
39
+
40
+ // Normalize form controls
41
+ //
42
+ // While most of our form styles require extra classes, some basic normalization
43
+ // is required to ensure optimum display with or without those classes to better
44
+ // address browser inconsistencies.
45
+
46
+ // Override content-box in Normalize (* isn't specific enough)
47
+ input[type="search"] {
48
+ .box-sizing(border-box);
49
+ }
50
+
51
+ // Position radios and checkboxes better
52
+ input[type="radio"],
53
+ input[type="checkbox"] {
54
+ margin: 4px 0 0;
55
+ margin-top: 1px \9; // IE8-9
56
+ line-height: normal;
57
+ }
58
+
59
+ // Set the height of file controls to match text inputs
60
+ input[type="file"] {
61
+ display: block;
62
+ }
63
+
64
+ // Make range inputs behave like textual form controls
65
+ input[type="range"] {
66
+ display: block;
67
+ width: 100%;
68
+ }
69
+
70
+ // Make multiple select elements height not fixed
71
+ select[multiple],
72
+ select[size] {
73
+ height: auto;
74
+ }
75
+
76
+ // Focus for file, radio, and checkbox
77
+ input[type="file"]:focus,
78
+ input[type="radio"]:focus,
79
+ input[type="checkbox"]:focus {
80
+ .tab-focus();
81
+ }
82
+
83
+ // Adjust output element
84
+ output {
85
+ display: block;
86
+ padding-top: (@padding-base-vertical + 1);
87
+ font-size: @font-size-base;
88
+ line-height: @line-height-base;
89
+ color: @input-color;
90
+ }
91
+
92
+
93
+ // Common form controls
94
+ //
95
+ // Shared size and type resets for form controls. Apply `.form-control` to any
96
+ // of the following form controls:
97
+ //
98
+ // select
99
+ // textarea
100
+ // input[type="text"]
101
+ // input[type="password"]
102
+ // input[type="datetime"]
103
+ // input[type="datetime-local"]
104
+ // input[type="date"]
105
+ // input[type="month"]
106
+ // input[type="time"]
107
+ // input[type="week"]
108
+ // input[type="number"]
109
+ // input[type="email"]
110
+ // input[type="url"]
111
+ // input[type="search"]
112
+ // input[type="tel"]
113
+ // input[type="color"]
114
+
115
+ .form-control {
116
+ display: block;
117
+ width: 100%;
118
+ height: @input-height-base; // Make inputs at least the height of their button counterpart (base line-height + padding + border)
119
+ padding: @padding-base-vertical @padding-base-horizontal;
120
+ font-size: @font-size-base;
121
+ line-height: @line-height-base;
122
+ color: @input-color;
123
+ background-color: @input-bg;
124
+ background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214
125
+ border: 1px solid @input-border;
126
+ border-radius: @input-border-radius;
127
+ .box-shadow(inset 0 1px 1px rgba(0,0,0,.075));
128
+ .transition(~"border-color ease-in-out .15s, box-shadow ease-in-out .15s");
129
+
130
+ // Customize the `:focus` state to imitate native WebKit styles.
131
+ .form-control-focus();
132
+
133
+ // Placeholder
134
+ .placeholder();
135
+
136
+ // Disabled and read-only inputs
137
+ //
138
+ // HTML5 says that controls under a fieldset > legend:first-child won't be
139
+ // disabled if the fieldset is disabled. Due to implementation difficulty, we
140
+ // don't honor that edge case; we style them as disabled anyway.
141
+ &[disabled],
142
+ &[readonly],
143
+ fieldset[disabled] & {
144
+ cursor: not-allowed;
145
+ background-color: @input-bg-disabled;
146
+ opacity: 1; // iOS fix for unreadable disabled content
147
+ }
148
+
149
+ // Reset height for `textarea`s
150
+ textarea& {
151
+ height: auto;
152
+ }
153
+ }
154
+
155
+
156
+ // Search inputs in iOS
157
+ //
158
+ // This overrides the extra rounded corners on search inputs in iOS so that our
159
+ // `.form-control` class can properly style them. Note that this cannot simply
160
+ // be added to `.form-control` as it's not specific enough. For details, see
161
+ // https://github.com/twbs/bootstrap/issues/11586.
162
+
163
+ input[type="search"] {
164
+ -webkit-appearance: none;
165
+ }
166
+
167
+
168
+ // Special styles for iOS temporal inputs
169
+ //
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"] {
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
+ }
190
+ }
191
+
192
+
193
+ // Form groups
194
+ //
195
+ // Designed to help with the organization and spacing of vertical forms. For
196
+ // horizontal forms, use the predefined grid classes.
197
+
198
+ .form-group {
199
+ margin-bottom: 15px;
200
+ }
201
+
202
+
203
+ // Checkboxes and radios
204
+ //
205
+ // Indent the labels to position radios/checkboxes as hanging controls.
206
+
207
+ .radio,
208
+ .checkbox {
209
+ position: relative;
210
+ display: block;
211
+ min-height: @line-height-computed; // clear the floating input if there is no label text
212
+ margin-top: 10px;
213
+ margin-bottom: 10px;
214
+
215
+ label {
216
+ padding-left: 20px;
217
+ margin-bottom: 0;
218
+ font-weight: normal;
219
+ cursor: pointer;
220
+ }
221
+ }
222
+ .radio input[type="radio"],
223
+ .radio-inline input[type="radio"],
224
+ .checkbox input[type="checkbox"],
225
+ .checkbox-inline input[type="checkbox"] {
226
+ position: absolute;
227
+ margin-left: -20px;
228
+ margin-top: 4px \9;
229
+ }
230
+
231
+ .radio + .radio,
232
+ .checkbox + .checkbox {
233
+ margin-top: -5px; // Move up sibling radios or checkboxes for tighter spacing
234
+ }
235
+
236
+ // Radios and checkboxes on same line
237
+ .radio-inline,
238
+ .checkbox-inline {
239
+ display: inline-block;
240
+ padding-left: 20px;
241
+ margin-bottom: 0;
242
+ vertical-align: middle;
243
+ font-weight: normal;
244
+ cursor: pointer;
245
+ }
246
+ .radio-inline + .radio-inline,
247
+ .checkbox-inline + .checkbox-inline {
248
+ margin-top: 0;
249
+ margin-left: 10px; // space out consecutive inline controls
250
+ }
251
+
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`.
254
+ //
255
+ // Note: Neither radios nor checkboxes can be readonly.
256
+ input[type="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
265
+ .radio-inline,
266
+ .checkbox-inline {
267
+ &.disabled,
268
+ fieldset[disabled] & {
269
+ cursor: not-allowed;
270
+ }
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
+ }
302
+
303
+
304
+ // Form control sizing
305
+ //
306
+ // Build on `.form-control` with modifier classes to decrease or increase the
307
+ // height and font-size of form controls.
308
+
309
+ .input-sm {
310
+ .input-size(@input-height-small; @padding-small-vertical; @padding-small-horizontal; @font-size-small; @line-height-small; @border-radius-small);
311
+ }
312
+
313
+ .input-lg {
314
+ .input-size(@input-height-large; @padding-large-vertical; @padding-large-horizontal; @font-size-large; @line-height-large; @border-radius-large);
315
+ }
316
+
317
+
318
+ // Form control feedback states
319
+ //
320
+ // Apply contextual and semantic states to individual form controls.
321
+
322
+ .has-feedback {
323
+ // Enable absolute positioning
324
+ position: relative;
325
+
326
+ // Ensure icons don't overlap text
327
+ .form-control {
328
+ padding-right: (@input-height-base * 1.25);
329
+ }
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;
352
+ }
353
+
354
+ // Feedback states
355
+ .has-success {
356
+ .form-control-validation(@state-success-text; @state-success-text; @state-success-bg);
357
+ }
358
+ .has-warning {
359
+ .form-control-validation(@state-warning-text; @state-warning-text; @state-warning-bg);
360
+ }
361
+ .has-error {
362
+ .form-control-validation(@state-danger-text; @state-danger-text; @state-danger-bg);
363
+ }
364
+
365
+
366
+ // Reposition feedback icon if label is hidden with "screenreader only" state
367
+ .has-feedback label.sr-only ~ .form-control-feedback {
368
+ top: 0;
369
+ }
370
+
371
+
372
+ // Help text
373
+ //
374
+ // Apply to any element you wish to create light text for placement immediately
375
+ // below a form control. Use for general help, formatting, or instructional text.
376
+
377
+ .help-block {
378
+ display: block; // account for any element using help-block
379
+ margin-top: 5px;
380
+ margin-bottom: 10px;
381
+ color: lighten(@text-color, 25%); // lighten the text some for contrast
382
+ }
383
+
384
+
385
+
386
+ // Inline forms
387
+ //
388
+ // Make forms appear inline(-block) by adding the `.form-inline` class. Inline
389
+ // forms begin stacked on extra small (mobile) devices and then go inline when
390
+ // viewports reach <768px.
391
+ //
392
+ // Requires wrapping inputs and labels with `.form-group` for proper display of
393
+ // default HTML form controls and our custom form controls (e.g., input groups).
394
+ //
395
+ // Heads up! This is mixin-ed into `.navbar-form` in navbars.less.
396
+
397
+ .form-inline {
398
+
399
+ // Kick in the inline
400
+ @media (min-width: @screen-sm-min) {
401
+ // Inline-block all the things for "inline"
402
+ .form-group {
403
+ display: inline-block;
404
+ margin-bottom: 0;
405
+ vertical-align: middle;
406
+ }
407
+
408
+ // In navbar-form, allow folks to *not* use `.form-group`
409
+ .form-control {
410
+ display: inline-block;
411
+ width: auto; // Prevent labels from stacking above inputs in `.form-group`
412
+ vertical-align: middle;
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
+
426
+ // Input groups need that 100% width though
427
+ .input-group > .form-control {
428
+ width: 100%;
429
+ }
430
+
431
+ .control-label {
432
+ margin-bottom: 0;
433
+ vertical-align: middle;
434
+ }
435
+
436
+ // Remove default margin on radios/checkboxes that were used for stacking, and
437
+ // then undo the floating of radios and checkboxes to match (which also avoids
438
+ // a bug in WebKit: https://github.com/twbs/bootstrap/issues/1969).
439
+ .radio,
440
+ .checkbox {
441
+ display: inline-block;
442
+ margin-top: 0;
443
+ margin-bottom: 0;
444
+ vertical-align: middle;
445
+
446
+ label {
447
+ padding-left: 0;
448
+ }
449
+ }
450
+ .radio input[type="radio"],
451
+ .checkbox input[type="checkbox"] {
452
+ position: relative;
453
+ margin-left: 0;
454
+ }
455
+
456
+ // Validation states
457
+ //
458
+ // Reposition the icon because it's now within a grid column and columns have
459
+ // `position: relative;` on them. Also accounts for the grid gutter padding.
460
+ .has-feedback .form-control-feedback {
461
+ top: 0;
462
+ }
463
+ }
464
+ }
465
+
466
+
467
+ // Horizontal forms
468
+ //
469
+ // Horizontal forms are built on grid classes and allow you to create forms with
470
+ // labels on the left and inputs on the right.
471
+
472
+ .form-horizontal {
473
+
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.
477
+ .radio,
478
+ .checkbox,
479
+ .radio-inline,
480
+ .checkbox-inline {
481
+ margin-top: 0;
482
+ margin-bottom: 0;
483
+ padding-top: (@padding-base-vertical + 1); // Default padding plus a border
484
+ }
485
+ // Account for padding we're adding to ensure the alignment and of help text
486
+ // and other content below items
487
+ .radio,
488
+ .checkbox {
489
+ min-height: (@line-height-computed + (@padding-base-vertical + 1));
490
+ }
491
+
492
+ // Make form groups behave like rows
493
+ .form-group {
494
+ .make-row();
495
+ }
496
+
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.
499
+ @media (min-width: @screen-sm-min) {
500
+ .control-label {
501
+ text-align: right;
502
+ margin-bottom: 0;
503
+ padding-top: (@padding-base-vertical + 1); // Default padding plus a border
504
+ }
505
+ }
506
+
507
+ // Validation states
508
+ //
509
+ // Reposition the icon because it's now within a grid column and columns have
510
+ // `position: relative;` on them. Also accounts for the grid gutter padding.
511
+ .has-feedback .form-control-feedback {
512
+ top: 0;
513
+ right: (@grid-gutter-width / 2);
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
+ }
540
+ }