padrino-admin 0.11.3 → 0.11.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +7 -0
  2. data/README.rdoc +3 -3
  3. data/lib/padrino-admin/access_control.rb +46 -47
  4. data/lib/padrino-admin/bootstrap-less/alerts.less +29 -55
  5. data/lib/padrino-admin/bootstrap-less/badges.less +13 -15
  6. data/lib/padrino-admin/bootstrap-less/bootstrap.less +17 -21
  7. data/lib/padrino-admin/bootstrap-less/breadcrumbs.less +6 -11
  8. data/lib/padrino-admin/bootstrap-less/button-groups.less +114 -32
  9. data/lib/padrino-admin/bootstrap-less/buttons.less +41 -41
  10. data/lib/padrino-admin/bootstrap-less/carousel.less +43 -18
  11. data/lib/padrino-admin/bootstrap-less/close.less +4 -4
  12. data/lib/padrino-admin/bootstrap-less/code.less +8 -10
  13. data/lib/padrino-admin/bootstrap-less/component-animations.less +10 -4
  14. data/lib/padrino-admin/bootstrap-less/dropdowns.less +78 -51
  15. data/lib/padrino-admin/bootstrap-less/forms.less +183 -274
  16. data/lib/padrino-admin/bootstrap-less/glyphicons.less +232 -0
  17. data/lib/padrino-admin/bootstrap-less/grid.less +230 -88
  18. data/lib/padrino-admin/bootstrap-less/input-groups.less +127 -0
  19. data/lib/padrino-admin/bootstrap-less/jumbotron.less +16 -8
  20. data/lib/padrino-admin/bootstrap-less/labels.less +25 -37
  21. data/lib/padrino-admin/bootstrap-less/list-group.less +34 -35
  22. data/lib/padrino-admin/bootstrap-less/media.less +7 -5
  23. data/lib/padrino-admin/bootstrap-less/mixins.less +321 -108
  24. data/lib/padrino-admin/bootstrap-less/modals.less +24 -20
  25. data/lib/padrino-admin/bootstrap-less/navbar.less +474 -216
  26. data/lib/padrino-admin/bootstrap-less/navs.less +67 -85
  27. data/lib/padrino-admin/bootstrap-less/pager.less +4 -4
  28. data/lib/padrino-admin/bootstrap-less/pagination.less +64 -69
  29. data/lib/padrino-admin/bootstrap-less/panels.less +114 -62
  30. data/lib/padrino-admin/bootstrap-less/popovers.less +18 -18
  31. data/lib/padrino-admin/bootstrap-less/print.less +22 -7
  32. data/lib/padrino-admin/bootstrap-less/progress-bars.less +10 -33
  33. data/lib/padrino-admin/bootstrap-less/responsive-utilities.less +141 -40
  34. data/lib/padrino-admin/bootstrap-less/scaffolding.less +66 -19
  35. data/lib/padrino-admin/bootstrap-less/tables.less +154 -158
  36. data/lib/padrino-admin/bootstrap-less/theme.less +232 -0
  37. data/lib/padrino-admin/bootstrap-less/thumbnails.less +9 -20
  38. data/lib/padrino-admin/bootstrap-less/tooltip.less +3 -3
  39. data/lib/padrino-admin/bootstrap-less/type.less +47 -55
  40. data/lib/padrino-admin/bootstrap-less/utilities.less +2 -2
  41. data/lib/padrino-admin/bootstrap-less/variables.less +289 -93
  42. data/lib/padrino-admin/bootstrap-less/wells.less +2 -2
  43. data/lib/padrino-admin/generators/actions.rb +11 -10
  44. data/lib/padrino-admin/generators/admin_app.rb +11 -11
  45. data/lib/padrino-admin/generators/admin_page.rb +9 -9
  46. data/lib/padrino-admin/generators/orm.rb +6 -7
  47. data/lib/padrino-admin/generators/templates/account/activerecord.rb.tt +7 -7
  48. data/lib/padrino-admin/generators/templates/account/couchrest.rb.tt +16 -16
  49. data/lib/padrino-admin/generators/templates/account/datamapper.rb.tt +7 -7
  50. data/lib/padrino-admin/generators/templates/account/minirecord.rb.tt +7 -7
  51. data/lib/padrino-admin/generators/templates/account/mongoid.rb.tt +8 -8
  52. data/lib/padrino-admin/generators/templates/account/mongomapper.rb.tt +7 -7
  53. data/lib/padrino-admin/generators/templates/account/ohm.rb.tt +9 -9
  54. data/lib/padrino-admin/generators/templates/account/sequel.rb.tt +8 -8
  55. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/affix.js +9 -3
  56. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/alert.js +4 -2
  57. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/bootstrap.min.js +4 -4
  58. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/button.js +9 -5
  59. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/carousel.js +19 -12
  60. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/collapse.js +68 -45
  61. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/dropdown.js +6 -7
  62. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/modal.js +43 -40
  63. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/popover.js +16 -10
  64. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/scrollspy.js +6 -4
  65. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/tab.js +4 -2
  66. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/tooltip.js +78 -48
  67. data/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/transition.js +10 -1
  68. data/lib/padrino-admin/generators/templates/assets/stylesheets/application.css +1 -0
  69. data/lib/padrino-admin/generators/templates/assets/stylesheets/bootstrap.css +622 -334
  70. data/lib/padrino-admin/generators/templates/erb/app/layouts/error.erb.tt +2 -2
  71. data/lib/padrino-admin/generators/templates/erb/app/sessions/new.erb.tt +9 -9
  72. data/lib/padrino-admin/generators/templates/erb/page/_form.erb.tt +3 -3
  73. data/lib/padrino-admin/generators/templates/erb/page/index.erb.tt +3 -3
  74. data/lib/padrino-admin/generators/templates/haml/app/layouts/error.haml.tt +1 -1
  75. data/lib/padrino-admin/generators/templates/haml/app/sessions/new.haml.tt +9 -7
  76. data/lib/padrino-admin/generators/templates/haml/page/_form.haml.tt +2 -2
  77. data/lib/padrino-admin/generators/templates/haml/page/index.haml.tt +2 -2
  78. data/lib/padrino-admin/generators/templates/page/controller.rb.tt +3 -3
  79. data/lib/padrino-admin/generators/templates/slim/app/layouts/error.slim.tt +1 -1
  80. data/lib/padrino-admin/generators/templates/slim/app/sessions/new.slim.tt +9 -7
  81. data/lib/padrino-admin/generators/templates/slim/page/_form.slim.tt +2 -2
  82. data/lib/padrino-admin/generators/templates/slim/page/index.slim.tt +2 -2
  83. data/lib/padrino-admin/helpers/authentication_helpers.rb +35 -35
  84. data/lib/padrino-admin/helpers/view_helpers.rb +12 -19
  85. data/lib/padrino-admin/utils/crypt.rb +10 -9
  86. data/lib/padrino-admin.rb +4 -5
  87. data/test/fixtures/data_mapper.rb +10 -9
  88. data/test/generators/test_account_model_generator.rb +2 -2
  89. metadata +14 -21
@@ -44,12 +44,12 @@
44
44
  }
45
45
 
46
46
  // Sizing shortcuts
47
- .size(@width, @height) {
47
+ .size(@width; @height) {
48
48
  width: @width;
49
49
  height: @height;
50
50
  }
51
51
  .square(@size) {
52
- .size(@size, @size);
52
+ .size(@size; @size);
53
53
  }
54
54
 
55
55
  // Placeholder text
@@ -110,82 +110,57 @@
110
110
  // Transitions
111
111
  .transition(@transition) {
112
112
  -webkit-transition: @transition;
113
- -moz-transition: @transition;
114
- -o-transition: @transition;
115
113
  transition: @transition;
116
114
  }
117
115
  .transition-delay(@transition-delay) {
118
116
  -webkit-transition-delay: @transition-delay;
119
- -moz-transition-delay: @transition-delay;
120
- -o-transition-delay: @transition-delay;
121
117
  transition-delay: @transition-delay;
122
118
  }
123
119
  .transition-duration(@transition-duration) {
124
120
  -webkit-transition-duration: @transition-duration;
125
- -moz-transition-duration: @transition-duration;
126
- -o-transition-duration: @transition-duration;
127
121
  transition-duration: @transition-duration;
128
122
  }
123
+ .transition-transform(@transition) {
124
+ -webkit-transition: -webkit-transform @transition;
125
+ -moz-transition: -moz-transform @transition;
126
+ -o-transition: -o-transform @transition;
127
+ transition: transform @transition;
128
+ }
129
129
 
130
130
  // Transformations
131
131
  .rotate(@degrees) {
132
132
  -webkit-transform: rotate(@degrees);
133
- -moz-transform: rotate(@degrees);
134
- -ms-transform: rotate(@degrees);
135
- -o-transform: rotate(@degrees);
133
+ -ms-transform: rotate(@degrees); // IE9+
136
134
  transform: rotate(@degrees);
137
135
  }
138
136
  .scale(@ratio) {
139
137
  -webkit-transform: scale(@ratio);
140
- -moz-transform: scale(@ratio);
141
- -ms-transform: scale(@ratio);
142
- -o-transform: scale(@ratio);
138
+ -ms-transform: scale(@ratio); // IE9+
143
139
  transform: scale(@ratio);
144
140
  }
145
- .translate(@x, @y) {
141
+ .translate(@x; @y) {
146
142
  -webkit-transform: translate(@x, @y);
147
- -moz-transform: translate(@x, @y);
148
- -ms-transform: translate(@x, @y);
149
- -o-transform: translate(@x, @y);
143
+ -ms-transform: translate(@x, @y); // IE9+
150
144
  transform: translate(@x, @y);
151
145
  }
152
- .skew(@x, @y) {
146
+ .skew(@x; @y) {
153
147
  -webkit-transform: skew(@x, @y);
154
- -moz-transform: skew(@x, @y);
155
- -ms-transform: skewX(@x) skewY(@y); // See https://github.com/twitter/bootstrap/issues/4885
156
- -o-transform: skew(@x, @y);
148
+ -ms-transform: skewX(@x) skewY(@y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+
157
149
  transform: skew(@x, @y);
158
150
  }
159
- .translate3d(@x, @y, @z) {
151
+ .translate3d(@x; @y; @z) {
160
152
  -webkit-transform: translate3d(@x, @y, @z);
161
- -moz-transform: translate3d(@x, @y, @z);
162
- -o-transform: translate3d(@x, @y, @z);
163
153
  transform: translate3d(@x, @y, @z);
164
154
  }
165
155
 
166
156
  // Backface visibility
167
157
  // Prevent browsers from flickering when using CSS 3D transforms.
168
- // Default value is `visible`, but can be changed to `hidden
158
+ // Default value is `visible`, but can be changed to `hidden`
169
159
  // See git pull https://github.com/dannykeane/bootstrap.git backface-visibility for examples
170
160
  .backface-visibility(@visibility){
171
- -webkit-backface-visibility: @visibility;
172
- -moz-backface-visibility: @visibility;
173
- backface-visibility: @visibility;
174
- }
175
-
176
- // Background clipping
177
- .background-clip(@clip) {
178
- -webkit-background-clip: @clip;
179
- -moz-background-clip: @clip;
180
- background-clip: @clip;
181
- }
182
-
183
- // Background sizing
184
- .background-size(@size) {
185
- -webkit-background-size: @size;
186
- -moz-background-size: @size;
187
- -o-background-size: @size;
188
- background-size: @size;
161
+ -webkit-backface-visibility: @visibility;
162
+ -moz-backface-visibility: @visibility;
163
+ backface-visibility: @visibility;
189
164
  }
190
165
 
191
166
  // Box sizing
@@ -200,7 +175,7 @@
200
175
  .user-select(@select) {
201
176
  -webkit-user-select: @select;
202
177
  -moz-user-select: @select;
203
- -ms-user-select: @select;
178
+ -ms-user-select: @select; // IE10+
204
179
  -o-user-select: @select;
205
180
  user-select: @select;
206
181
  }
@@ -212,7 +187,7 @@
212
187
  }
213
188
 
214
189
  // CSS3 Content Columns
215
- .content-columns(@column-count, @column-gap: @grid-gutter-width) {
190
+ .content-columns(@column-count; @column-gap: @grid-gutter-width) {
216
191
  -webkit-column-count: @column-count;
217
192
  -moz-column-count: @column-count;
218
193
  column-count: @column-count;
@@ -226,7 +201,7 @@
226
201
  word-wrap: break-word;
227
202
  -webkit-hyphens: @mode;
228
203
  -moz-hyphens: @mode;
229
- -ms-hyphens: @mode;
204
+ -ms-hyphens: @mode; // IE10+
230
205
  -o-hyphens: @mode;
231
206
  hyphens: @mode;
232
207
  }
@@ -250,8 +225,7 @@
250
225
  //
251
226
  // Creates two color stops, start and end, by specifying a color and position for each color stop.
252
227
  // Color stops are not available in IE9 and below.
253
- .horizontal(@start-color: #555; @start-percent: 0%; @end-color: #333; @end-percent: 100%) {
254
- background-color: @end-color;
228
+ .horizontal(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) {
255
229
  background-image: -webkit-gradient(linear, @start-percent top, @end-percent top, from(@start-color), to(@end-color)); // Safari 4+, Chrome 2+
256
230
  background-image: -webkit-linear-gradient(left, color-stop(@start-color @start-percent), color-stop(@end-color @end-percent)); // Safari 5.1+, Chrome 10+
257
231
  background-image: -moz-linear-gradient(left, @start-color @start-percent, @end-color @end-percent); // FF 3.6+
@@ -264,8 +238,7 @@
264
238
  //
265
239
  // Creates two color stops, start and end, by specifying a color and position for each color stop.
266
240
  // Color stops are not available in IE9 and below.
267
- .vertical(@start-color: #555; @start-percent: 0%; @end-color: #333; @end-percent: 100%) {
268
- background-color: @end-color;
241
+ .vertical(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) {
269
242
  background-image: -webkit-gradient(linear, left @start-percent, left @end-percent, from(@start-color), to(@end-color)); // Safari 4+, Chrome 2+
270
243
  background-image: -webkit-linear-gradient(top, @start-color, @start-percent, @end-color, @end-percent); // Safari 5.1+, Chrome 10+
271
244
  background-image: -moz-linear-gradient(top, @start-color @start-percent, @end-color @end-percent); // FF 3.6+
@@ -274,15 +247,13 @@
274
247
  filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@start-color),argb(@end-color))); // IE9 and down
275
248
  }
276
249
 
277
- .directional(@start-color: #555, @end-color: #333, @deg: 45deg) {
278
- background-color: @end-color;
250
+ .directional(@start-color: #555; @end-color: #333; @deg: 45deg) {
279
251
  background-repeat: repeat-x;
280
252
  background-image: -webkit-linear-gradient(@deg, @start-color, @end-color); // Safari 5.1+, Chrome 10+
281
253
  background-image: -moz-linear-gradient(@deg, @start-color, @end-color); // FF 3.6+
282
254
  background-image: linear-gradient(@deg, @start-color, @end-color); // Standard, IE10
283
255
  }
284
- .horizontal-three-colors(@start-color: #00b3ee, @mid-color: #7a43b6, @color-stop: 50%, @end-color: #c3325f) {
285
- background-color: mix(@mid-color, @end-color, 80%);
256
+ .horizontal-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) {
286
257
  background-image: -webkit-gradient(left, linear, 0 0, 0 100%, from(@start-color), color-stop(@color-stop, @mid-color), to(@end-color));
287
258
  background-image: -webkit-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color);
288
259
  background-image: -moz-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color);
@@ -290,9 +261,7 @@
290
261
  background-repeat: no-repeat;
291
262
  filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",argb(@start-color),argb(@end-color))); // IE9 and down, gets no color-stop at all for proper fallback
292
263
  }
293
-
294
- .vertical-three-colors(@start-color: #00b3ee, @mid-color: #7a43b6, @color-stop: 50%, @end-color: #c3325f) {
295
- background-color: mix(@mid-color, @end-color, 80%);
264
+ .vertical-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) {
296
265
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@start-color), color-stop(@color-stop, @mid-color), to(@end-color));
297
266
  background-image: -webkit-linear-gradient(@start-color, @mid-color @color-stop, @end-color);
298
267
  background-image: -moz-linear-gradient(top, @start-color, @mid-color @color-stop, @end-color);
@@ -300,16 +269,14 @@
300
269
  background-repeat: no-repeat;
301
270
  filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@start-color),argb(@end-color))); // IE9 and down, gets no color-stop at all for proper fallback
302
271
  }
303
- .radial(@inner-color: #555, @outer-color: #333) {
304
- background-color: @outer-color;
272
+ .radial(@inner-color: #555; @outer-color: #333) {
305
273
  background-image: -webkit-gradient(radial, center center, 0, center center, 460, from(@inner-color), to(@outer-color));
306
274
  background-image: -webkit-radial-gradient(circle, @inner-color, @outer-color);
307
275
  background-image: -moz-radial-gradient(circle, @inner-color, @outer-color);
308
276
  background-image: radial-gradient(circle, @inner-color, @outer-color);
309
277
  background-repeat: no-repeat;
310
278
  }
311
- .striped(@color: #555, @angle: 45deg) {
312
- background-color: @color;
279
+ .striped(@color: #555; @angle: 45deg) {
313
280
  background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(.25, rgba(255,255,255,.15)), color-stop(.25, transparent), color-stop(.5, transparent), color-stop(.5, rgba(255,255,255,.15)), color-stop(.75, rgba(255,255,255,.15)), color-stop(.75, transparent), to(transparent));
314
281
  background-image: -webkit-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
315
282
  background-image: -moz-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
@@ -319,7 +286,7 @@
319
286
 
320
287
  // Reset filters for IE
321
288
  //
322
- // When you need to remove a gradient background, don't forget to use this to reset
289
+ // When you need to remove a gradient background, do not forget to use this to reset
323
290
  // the IE filter for IE9 and below.
324
291
  .reset-filter() {
325
292
  filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)"));
@@ -327,11 +294,11 @@
327
294
 
328
295
 
329
296
 
330
- // RETINA IMAGE SUPPORT
331
- // --------------------------------------------------
332
-
297
+ // Retina images
298
+ //
333
299
  // Short retina mixin for setting background-image and -size
334
- .retina-image(@file-1x, @file-2x, @width-1x, @height-1x) {
300
+
301
+ .img-retina(@file-1x; @file-2x; @width-1x; @height-1x) {
335
302
  background-image: url("@{file-1x}");
336
303
 
337
304
  @media
@@ -347,25 +314,97 @@
347
314
  }
348
315
 
349
316
 
317
+ // Responsive image
318
+ //
319
+ // Keep images from scaling beyond the width of their parents.
320
+
321
+ .img-responsive(@display: block;) {
322
+ display: @display;
323
+ max-width: 100%; // Part 1: Set a maximum relative to the parent
324
+ height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching
325
+ }
326
+
327
+
350
328
  // COMPONENT MIXINS
351
329
  // --------------------------------------------------
352
330
 
353
331
  // Horizontal dividers
354
332
  // -------------------------
355
333
  // Dividers (basically an hr) within dropdowns and nav lists
356
- .nav-divider(@top: #e5e5e5, @bottom: #fff) {
357
- height: 2px; // 1px for background, one for border
334
+ .nav-divider(@color: #e5e5e5) {
335
+ height: 1px;
358
336
  margin: ((@line-height-computed / 2) - 1) 0;
359
337
  overflow: hidden;
360
- background-color: @top;
361
- border-bottom: 1px solid @bottom;
338
+ background-color: @color;
339
+ }
340
+
341
+ // Panels
342
+ // -------------------------
343
+ .panel-variant(@border; @heading-text-color; @heading-bg-color; @heading-border;) {
344
+ border-color: @border;
345
+ & > .panel-heading {
346
+ color: @heading-text-color;
347
+ background-color: @heading-bg-color;
348
+ border-color: @heading-border;
349
+ + .panel-collapse .panel-body {
350
+ border-top-color: @border;
351
+ }
352
+ }
353
+ & > .panel-footer {
354
+ + .panel-collapse .panel-body {
355
+ border-bottom-color: @border;
356
+ }
357
+ }
358
+ }
359
+
360
+ // Alerts
361
+ // -------------------------
362
+ .alert-variant(@background; @border; @text-color) {
363
+ background-color: @background;
364
+ border-color: @border;
365
+ color: @text-color;
366
+ hr {
367
+ border-top-color: darken(@border, 5%);
368
+ }
369
+ .alert-link {
370
+ color: darken(@text-color, 10%);
371
+ }
372
+ }
373
+
374
+ // Tables
375
+ // -------------------------
376
+ .table-row-variant(@state; @background; @border) {
377
+ // Exact selectors below required to override `.table-striped` and prevent
378
+ // inheritance to nested tables.
379
+ .table > thead > tr,
380
+ .table > tbody > tr,
381
+ .table > tfoot > tr {
382
+ > td.@{state},
383
+ > th.@{state},
384
+ &.@{state} > td,
385
+ &.@{state} > th {
386
+ background-color: @background;
387
+ border-color: @border;
388
+ }
389
+ }
390
+
391
+ // Hover states for `.table-hover`
392
+ // Note: this is not available for cells or rows within `thead` or `tfoot`.
393
+ .table-hover > tbody > tr {
394
+ > td.@{state}:hover,
395
+ > th.@{state}:hover,
396
+ &.@{state}:hover > td {
397
+ background-color: darken(@background, 5%);
398
+ border-color: darken(@border, 5%);
399
+ }
400
+ }
362
401
  }
363
402
 
364
- // Button psuedo states
403
+ // Button variants
365
404
  // -------------------------
366
405
  // Easily pump out default styles, as well as :hover, :focus, :active,
367
406
  // and disabled options for all buttons
368
- .btn-pseudo-states(@color, @background, @border) {
407
+ .button-variant(@color; @background; @border) {
369
408
  color: @color;
370
409
  background-color: @background;
371
410
  border-color: @border;
@@ -373,11 +412,17 @@
373
412
  &:hover,
374
413
  &:focus,
375
414
  &:active,
376
- &.active {
377
- background-color: darken(@background, 5%);
378
- border-color: darken(@border, 10%);
415
+ &.active,
416
+ .open .dropdown-toggle& {
417
+ color: @color;
418
+ background-color: darken(@background, 8%);
419
+ border-color: darken(@border, 12%);
420
+ }
421
+ &:active,
422
+ &.active,
423
+ .open .dropdown-toggle& {
424
+ background-image: none;
379
425
  }
380
-
381
426
  &.disabled,
382
427
  &[disabled],
383
428
  fieldset[disabled] & {
@@ -392,15 +437,69 @@
392
437
  }
393
438
  }
394
439
 
440
+ // Button sizes
441
+ // -------------------------
442
+ .button-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) {
443
+ padding: @padding-vertical @padding-horizontal;
444
+ font-size: @font-size;
445
+ line-height: @line-height;
446
+ border-radius: @border-radius;
447
+ }
448
+
449
+ // Pagination
450
+ // -------------------------
451
+ .pagination-size(@padding-vertical; @padding-horizontal; @font-size; @border-radius) {
452
+ > li {
453
+ > a,
454
+ > span {
455
+ padding: @padding-vertical @padding-horizontal;
456
+ font-size: @font-size;
457
+ }
458
+ &:first-child {
459
+ > a,
460
+ > span {
461
+ .border-left-radius(@border-radius);
462
+ }
463
+ }
464
+ &:last-child {
465
+ > a,
466
+ > span {
467
+ .border-right-radius(@border-radius);
468
+ }
469
+ }
470
+ }
471
+ }
472
+
473
+ // Labels
474
+ // -------------------------
475
+ .label-variant(@color) {
476
+ background-color: @color;
477
+ &[href] {
478
+ &:hover,
479
+ &:focus {
480
+ background-color: darken(@color, 10%);
481
+ }
482
+ }
483
+ }
484
+
395
485
  // Navbar vertical align
396
486
  // -------------------------
397
487
  // Vertically center elements in the navbar.
398
- // Example: an element has a height of 30px, so write out `.navbarVerticalAlign(30px);` to calculate the appropriate top margin.
488
+ // Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin.
399
489
  .navbar-vertical-align(@element-height) {
400
490
  margin-top: ((@navbar-height - @element-height) / 2);
401
491
  margin-bottom: ((@navbar-height - @element-height) / 2);
402
492
  }
403
493
 
494
+ // Progress bars
495
+ // -------------------------
496
+ .progress-bar-variant(@color) {
497
+ background-color: @color;
498
+ .progress-striped & {
499
+ #gradient > .striped(@color);
500
+ }
501
+ }
502
+
404
503
  // Responsive utilities
405
504
  // -------------------------
406
505
  // More easily include all the states for responsive-utilities.less.
@@ -425,74 +524,143 @@
425
524
  .container-fixed() {
426
525
  margin-right: auto;
427
526
  margin-left: auto;
527
+ padding-left: (@grid-gutter-width / 2);
528
+ padding-right: (@grid-gutter-width / 2);
428
529
  .clearfix();
429
530
  }
430
531
 
431
- // Make a grid
432
-
433
532
  // Creates a wrapper for a series of columns
434
- .make-row() {
435
- // Then clear the floated columns
533
+ .make-row(@gutter: @grid-gutter-width) {
534
+ margin-left: (@gutter / -2);
535
+ margin-right: (@gutter / -2);
436
536
  .clearfix();
537
+ }
538
+
539
+ // Generate the extra small columns
540
+ .make-xs-column(@columns; @gutter: @grid-gutter-width) {
541
+ position: relative;
542
+ float: left;
543
+ width: percentage((@columns / @grid-columns));
544
+ // Prevent columns from collapsing when empty
545
+ min-height: 1px;
546
+ // Inner gutter via padding
547
+ padding-left: (@gutter / 2);
548
+ padding-right: (@gutter / 2);
549
+ }
550
+
551
+ // Generate the small columns
552
+ .make-sm-column(@columns; @gutter: @grid-gutter-width) {
553
+ position: relative;
554
+ // Prevent columns from collapsing when empty
555
+ min-height: 1px;
556
+ // Inner gutter via padding
557
+ padding-left: (@gutter / 2);
558
+ padding-right: (@gutter / 2);
437
559
 
438
- @media (min-width: @screen-small) {
439
- margin-left: (@grid-gutter-width / -2);
440
- margin-right: (@grid-gutter-width / -2);
560
+ // Calculate width based on number of columns available
561
+ @media (min-width: @screen-sm) {
562
+ float: left;
563
+ width: percentage((@columns / @grid-columns));
441
564
  }
565
+ }
442
566
 
443
- // Negative margin nested rows out to align the content of columns
444
- .row {
445
- margin-left: (@grid-gutter-width / -2);
446
- margin-right: (@grid-gutter-width / -2);
567
+ // Generate the small column offsets
568
+ .make-sm-column-offset(@columns) {
569
+ @media (min-width: @screen-sm) {
570
+ margin-left: percentage((@columns / @grid-columns));
571
+ }
572
+ }
573
+ .make-sm-column-push(@columns) {
574
+ @media (min-width: @screen-sm) {
575
+ left: percentage((@columns / @grid-columns));
576
+ }
577
+ }
578
+ .make-sm-column-pull(@columns) {
579
+ @media (min-width: @screen-sm) {
580
+ right: percentage((@columns / @grid-columns));
447
581
  }
448
582
  }
449
- // Generate the columns
450
- .make-column(@columns) {
583
+
584
+ // Generate the medium columns
585
+ .make-md-column(@columns; @gutter: @grid-gutter-width) {
451
586
  position: relative;
452
587
  // Prevent columns from collapsing when empty
453
588
  min-height: 1px;
454
589
  // Inner gutter via padding
455
- padding-left: (@grid-gutter-width / 2);
456
- padding-right: (@grid-gutter-width / 2);
590
+ padding-left: (@gutter / 2);
591
+ padding-right: (@gutter / 2);
457
592
 
458
593
  // Calculate width based on number of columns available
459
- @media (min-width: @grid-float-breakpoint) {
594
+ @media (min-width: @screen-md) {
460
595
  float: left;
461
596
  width: percentage((@columns / @grid-columns));
462
597
  }
463
598
  }
464
- // Generate the column offsets
465
- .make-column-offset(@columns) {
466
- @media (min-width: @grid-float-breakpoint) {
599
+
600
+ // Generate the large column offsets
601
+ .make-md-column-offset(@columns) {
602
+ @media (min-width: @screen-md) {
467
603
  margin-left: percentage((@columns / @grid-columns));
468
604
  }
469
605
  }
470
- .make-column-push(@columns) {
471
- @media (min-width: @grid-float-breakpoint) {
606
+ .make-md-column-push(@columns) {
607
+ @media (min-width: @screen-md) {
472
608
  left: percentage((@columns / @grid-columns));
473
609
  }
474
610
  }
475
- .make-column-pull(@columns) {
476
- @media (min-width: @grid-float-breakpoint) {
611
+ .make-md-column-pull(@columns) {
612
+ @media (min-width: @screen-md) {
477
613
  right: percentage((@columns / @grid-columns));
478
614
  }
479
615
  }
480
616
 
617
+ // Generate the large columns
618
+ .make-lg-column(@columns; @gutter: @grid-gutter-width) {
619
+ position: relative;
620
+ // Prevent columns from collapsing when empty
621
+ min-height: 1px;
622
+ // Inner gutter via padding
623
+ padding-left: (@gutter / 2);
624
+ padding-right: (@gutter / 2);
481
625
 
626
+ // Calculate width based on number of columns available
627
+ @media (min-width: @screen-lg) {
628
+ float: left;
629
+ width: percentage((@columns / @grid-columns));
630
+ }
631
+ }
482
632
 
483
- // Framework mixins
484
- // --------------------------------------------------
633
+ // Generate the large column offsets
634
+ .make-lg-column-offset(@columns) {
635
+ @media (min-width: @screen-lg) {
636
+ margin-left: percentage((@columns / @grid-columns));
637
+ }
638
+ }
639
+ .make-lg-column-push(@columns) {
640
+ @media (min-width: @screen-lg) {
641
+ left: percentage((@columns / @grid-columns));
642
+ }
643
+ }
644
+ .make-lg-column-pull(@columns) {
645
+ @media (min-width: @screen-lg) {
646
+ right: percentage((@columns / @grid-columns));
647
+ }
648
+ }
485
649
 
486
- // Generate form validation states
487
- .form-field-validation(@text-color: #555, @border-color: #ccc, @background-color: #f5f5f5) {
488
- // Color the label text
650
+
651
+ // Form validation states
652
+ //
653
+ // Used in forms.less to generate the form validation CSS for warnings, errors,
654
+ // and successes.
655
+
656
+ .form-control-validation(@text-color: #555; @border-color: #ccc; @background-color: #f5f5f5) {
657
+ // Color the label and help text
489
658
  .help-block,
490
659
  .control-label {
491
660
  color: @text-color;
492
661
  }
493
662
  // Set the border and box shadow on specific inputs to match
494
- .input-with-feedback {
495
- padding-right: 32px; // to account for the feedback icon
663
+ .form-control {
496
664
  border-color: @border-color;
497
665
  .box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work
498
666
  &:focus {
@@ -508,3 +676,48 @@
508
676
  background-color: @background-color;
509
677
  }
510
678
  }
679
+
680
+ // Form control focus state
681
+ //
682
+ // Generate a customized focus state and for any input with the specified color,
683
+ // which defaults to the `@input-focus-border` variable.
684
+ //
685
+ // We highly encourage you to not customize the default value, but instead use
686
+ // this to tweak colors on an as-needed basis. This aesthetic change is based on
687
+ // WebKit's default styles, but applicable to a wider range of browsers. Its
688
+ // usability and accessibility should be taken into account with any change.
689
+ //
690
+ // Example usage: change the default blue border and shadow to white for better
691
+ // contrast against a dark gray background.
692
+
693
+ .form-control-focus(@color: @input-border-focus) {
694
+ @color-rgba: rgba(red(@color), green(@color), blue(@color), .6);
695
+ &:focus {
696
+ border-color: @color;
697
+ outline: 0;
698
+ .box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px @{color-rgba}");
699
+ }
700
+ }
701
+
702
+ // Form control sizing
703
+ //
704
+ // Relative text size, padding, and border-radii changes for form controls. For
705
+ // horizontal sizing, wrap controls in the predefined grid classes. `<select>`
706
+ // element gets special love because it's special, and that's a fact!
707
+
708
+ .input-size(@input-height; @padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) {
709
+ height: @input-height;
710
+ padding: @padding-vertical @padding-horizontal;
711
+ font-size: @font-size;
712
+ line-height: @line-height;
713
+ border-radius: @border-radius;
714
+
715
+ select& {
716
+ height: @input-height;
717
+ line-height: @input-height;
718
+ }
719
+
720
+ textarea& {
721
+ height: auto;
722
+ }
723
+ }