bootswatch-theme-rails 1.0.3

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 (75) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +17 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +37 -0
  6. data/Rakefile +1 -0
  7. data/bootswatch-theme-rails.gemspec +22 -0
  8. data/lib/bootswatch-theme-rails.rb +10 -0
  9. data/lib/bootswatch-theme-rails/engine.rb +8 -0
  10. data/lib/bootswatch-theme-rails/railtie.rb +7 -0
  11. data/lib/bootswatch-theme-rails/version.rb +7 -0
  12. data/vendor/assets/stylesheets/amelia.css +6 -0
  13. data/vendor/assets/stylesheets/amelia/base.less +10 -0
  14. data/vendor/assets/stylesheets/amelia/bootswatch.css.less +146 -0
  15. data/vendor/assets/stylesheets/amelia/loader.css.less +50 -0
  16. data/vendor/assets/stylesheets/amelia/variables.less +827 -0
  17. data/vendor/assets/stylesheets/cerulean.css +6 -0
  18. data/vendor/assets/stylesheets/cerulean/base.less +10 -0
  19. data/vendor/assets/stylesheets/cerulean/bootswatch.css.less +112 -0
  20. data/vendor/assets/stylesheets/cerulean/loader.css.less +50 -0
  21. data/vendor/assets/stylesheets/cerulean/variables.less +642 -0
  22. data/vendor/assets/stylesheets/cosmo.css +6 -0
  23. data/vendor/assets/stylesheets/cosmo/base.less +10 -0
  24. data/vendor/assets/stylesheets/cosmo/bootswatch.css.less +153 -0
  25. data/vendor/assets/stylesheets/cosmo/loader.css.less +50 -0
  26. data/vendor/assets/stylesheets/cosmo/variables.less +642 -0
  27. data/vendor/assets/stylesheets/cyborg.css +6 -0
  28. data/vendor/assets/stylesheets/cyborg/base.less +10 -0
  29. data/vendor/assets/stylesheets/cyborg/bootswatch.css.less +148 -0
  30. data/vendor/assets/stylesheets/cyborg/loader.css.less +50 -0
  31. data/vendor/assets/stylesheets/cyborg/variables.less +642 -0
  32. data/vendor/assets/stylesheets/flatly.css +6 -0
  33. data/vendor/assets/stylesheets/flatly/base.less +10 -0
  34. data/vendor/assets/stylesheets/flatly/bootswatch.css.less +187 -0
  35. data/vendor/assets/stylesheets/flatly/loader.css.less +50 -0
  36. data/vendor/assets/stylesheets/flatly/variables.less +642 -0
  37. data/vendor/assets/stylesheets/journal.css +6 -0
  38. data/vendor/assets/stylesheets/journal/base.less +10 -0
  39. data/vendor/assets/stylesheets/journal/bootswatch.css.less +5 -0
  40. data/vendor/assets/stylesheets/journal/loader.css.less +50 -0
  41. data/vendor/assets/stylesheets/journal/variables.less +645 -0
  42. data/vendor/assets/stylesheets/readable.css +6 -0
  43. data/vendor/assets/stylesheets/readable/base.less +10 -0
  44. data/vendor/assets/stylesheets/readable/bootswatch.css.less +98 -0
  45. data/vendor/assets/stylesheets/readable/loader.css.less +50 -0
  46. data/vendor/assets/stylesheets/readable/variables.less +642 -0
  47. data/vendor/assets/stylesheets/scaffolds.css.scss +69 -0
  48. data/vendor/assets/stylesheets/shared/mixins.less +848 -0
  49. data/vendor/assets/stylesheets/simplex.css +6 -0
  50. data/vendor/assets/stylesheets/simplex/base.less +10 -0
  51. data/vendor/assets/stylesheets/simplex/bootswatch.css.less +123 -0
  52. data/vendor/assets/stylesheets/simplex/loader.css.less +50 -0
  53. data/vendor/assets/stylesheets/simplex/variables.less +642 -0
  54. data/vendor/assets/stylesheets/slate.css +6 -0
  55. data/vendor/assets/stylesheets/slate/base.less +10 -0
  56. data/vendor/assets/stylesheets/slate/bootswatch.css.less +341 -0
  57. data/vendor/assets/stylesheets/slate/loader.css.less +50 -0
  58. data/vendor/assets/stylesheets/slate/variables.less +642 -0
  59. data/vendor/assets/stylesheets/spacelab.css +6 -0
  60. data/vendor/assets/stylesheets/spacelab/base.less +10 -0
  61. data/vendor/assets/stylesheets/spacelab/bootswatch.css.less +114 -0
  62. data/vendor/assets/stylesheets/spacelab/loader.css.less +50 -0
  63. data/vendor/assets/stylesheets/spacelab/variables.less +642 -0
  64. data/vendor/assets/stylesheets/sprite.css.scss +1 -0
  65. data/vendor/assets/stylesheets/united.css +6 -0
  66. data/vendor/assets/stylesheets/united/base.less +10 -0
  67. data/vendor/assets/stylesheets/united/bootswatch.css.less +33 -0
  68. data/vendor/assets/stylesheets/united/loader.css.less +50 -0
  69. data/vendor/assets/stylesheets/united/variables.less +642 -0
  70. data/vendor/assets/stylesheets/yeti.css +6 -0
  71. data/vendor/assets/stylesheets/yeti/base.less +10 -0
  72. data/vendor/assets/stylesheets/yeti/bootswatch.css.less +410 -0
  73. data/vendor/assets/stylesheets/yeti/loader.css.less +50 -0
  74. data/vendor/assets/stylesheets/yeti/variables.less +642 -0
  75. metadata +146 -0
@@ -0,0 +1,69 @@
1
+ body {
2
+ background-color: #fff;
3
+ color: #333;
4
+ font-family: verdana, arial, helvetica, sans-serif;
5
+ font-size: 13px;
6
+ line-height: 18px;
7
+ }
8
+
9
+ p, ol, ul, td {
10
+ font-family: verdana, arial, helvetica, sans-serif;
11
+ font-size: 13px;
12
+ line-height: 18px;
13
+ }
14
+
15
+ pre {
16
+ background-color: #eee;
17
+ padding: 10px;
18
+ font-size: 11px;
19
+ }
20
+
21
+ a {
22
+ color: #000;
23
+ &:visited {
24
+ color: #666;
25
+ }
26
+ &:hover {
27
+ color: #fff;
28
+ background-color: #000;
29
+ }
30
+ }
31
+
32
+ div {
33
+ &.field, &.actions {
34
+ margin-bottom: 10px;
35
+ }
36
+ }
37
+
38
+ #notice {
39
+ color: green;
40
+ }
41
+
42
+ .field_with_errors {
43
+ padding: 2px;
44
+ background-color: red;
45
+ display: table;
46
+ }
47
+
48
+ #error_explanation {
49
+ width: 450px;
50
+ border: 2px solid red;
51
+ padding: 7px;
52
+ padding-bottom: 0;
53
+ margin-bottom: 20px;
54
+ background-color: #f0f0f0;
55
+ h2 {
56
+ text-align: left;
57
+ font-weight: bold;
58
+ padding: 5px 5px 5px 15px;
59
+ font-size: 12px;
60
+ margin: -7px;
61
+ margin-bottom: 0px;
62
+ background-color: #c00;
63
+ color: #fff;
64
+ }
65
+ ul li {
66
+ font-size: 12px;
67
+ list-style: square;
68
+ }
69
+ }
@@ -0,0 +1,848 @@
1
+ // Shared
2
+ // Bootswatch
3
+
4
+ //
5
+ // Mixins
6
+ // --------------------------------------------------
7
+
8
+
9
+ // Utilities
10
+ // -------------------------
11
+
12
+ // Clearfix
13
+ // Source: http://nicolasgallagher.com/micro-clearfix-hack/
14
+ //
15
+ // For modern browsers
16
+ // 1. The space content is one way to avoid an Opera bug when the
17
+ // contenteditable attribute is included anywhere else in the document.
18
+ // Otherwise it causes space to appear at the top and bottom of elements
19
+ // that are clearfixed.
20
+ // 2. The use of `table` rather than `block` is only necessary if using
21
+ // `:before` to contain the top-margins of child elements.
22
+ .clearfix() {
23
+ &:before,
24
+ &:after {
25
+ content: " "; // 1
26
+ display: table; // 2
27
+ }
28
+ &:after {
29
+ clear: both;
30
+ }
31
+ }
32
+
33
+ // WebKit-style focus
34
+ .tab-focus() {
35
+ // Default
36
+ outline: thin dotted;
37
+ // WebKit
38
+ outline: 5px auto -webkit-focus-ring-color;
39
+ outline-offset: -2px;
40
+ }
41
+
42
+ // Center-align a block level element
43
+ .center-block() {
44
+ display: block;
45
+ margin-left: auto;
46
+ margin-right: auto;
47
+ }
48
+
49
+ // Sizing shortcuts
50
+ .size(@width; @height) {
51
+ width: @width;
52
+ height: @height;
53
+ }
54
+ .square(@size) {
55
+ .size(@size; @size);
56
+ }
57
+
58
+ // Placeholder text
59
+ .placeholder(@color: @input-color-placeholder) {
60
+ &:-moz-placeholder { color: @color; } // Firefox 4-18
61
+ &::-moz-placeholder { color: @color; // Firefox 19+
62
+ opacity: 1; } // See https://github.com/twbs/bootstrap/pull/11526
63
+ &:-ms-input-placeholder { color: @color; } // Internet Explorer 10+
64
+ &::-webkit-input-placeholder { color: @color; } // Safari and Chrome
65
+ }
66
+
67
+ // Text overflow
68
+ // Requires inline-block or block for proper styling
69
+ .text-overflow() {
70
+ overflow: hidden;
71
+ text-overflow: ellipsis;
72
+ white-space: nowrap;
73
+ }
74
+
75
+ // CSS image replacement
76
+ //
77
+ // Heads up! v3 launched with with only `.hide-text()`, but per our pattern for
78
+ // mixins being reused as classes with the same name, this doesn't hold up. As
79
+ // of v3.0.1 we have added `.text-hide()` and deprecated `.hide-text()`. Note
80
+ // that we cannot chain the mixins together in Less, so they are repeated.
81
+ //
82
+ // Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757
83
+
84
+ // Deprecated as of v3.0.1 (will be removed in v4)
85
+ .hide-text() {
86
+ font: ~"0/0" a;
87
+ color: transparent;
88
+ text-shadow: none;
89
+ background-color: transparent;
90
+ border: 0;
91
+ }
92
+ // New mixin to use as of v3.0.1
93
+ .text-hide() {
94
+ .hide-text();
95
+ }
96
+
97
+
98
+
99
+ // CSS3 PROPERTIES
100
+ // --------------------------------------------------
101
+
102
+ // Single side border-radius
103
+ .border-top-radius(@radius) {
104
+ border-top-right-radius: @radius;
105
+ border-top-left-radius: @radius;
106
+ }
107
+ .border-right-radius(@radius) {
108
+ border-bottom-right-radius: @radius;
109
+ border-top-right-radius: @radius;
110
+ }
111
+ .border-bottom-radius(@radius) {
112
+ border-bottom-right-radius: @radius;
113
+ border-bottom-left-radius: @radius;
114
+ }
115
+ .border-left-radius(@radius) {
116
+ border-bottom-left-radius: @radius;
117
+ border-top-left-radius: @radius;
118
+ }
119
+
120
+ // Drop shadows
121
+ .box-shadow(@shadow) {
122
+ -webkit-box-shadow: @shadow; // iOS <4.3 & Android <4.1
123
+ box-shadow: @shadow;
124
+ }
125
+
126
+ // Transitions
127
+ .transition(@transition) {
128
+ -webkit-transition: @transition;
129
+ transition: @transition;
130
+ }
131
+ .transition-property(@transition-property) {
132
+ -webkit-transition-property: @transition-property;
133
+ transition-property: @transition-property;
134
+ }
135
+ .transition-delay(@transition-delay) {
136
+ -webkit-transition-delay: @transition-delay;
137
+ transition-delay: @transition-delay;
138
+ }
139
+ .transition-duration(@transition-duration) {
140
+ -webkit-transition-duration: @transition-duration;
141
+ transition-duration: @transition-duration;
142
+ }
143
+ .transition-transform(@transition) {
144
+ -webkit-transition: -webkit-transform @transition;
145
+ -moz-transition: -moz-transform @transition;
146
+ -o-transition: -o-transform @transition;
147
+ transition: transform @transition;
148
+ }
149
+
150
+ // Transformations
151
+ .rotate(@degrees) {
152
+ -webkit-transform: rotate(@degrees);
153
+ -ms-transform: rotate(@degrees); // IE9+
154
+ transform: rotate(@degrees);
155
+ }
156
+ .scale(@ratio) {
157
+ -webkit-transform: scale(@ratio);
158
+ -ms-transform: scale(@ratio); // IE9+
159
+ transform: scale(@ratio);
160
+ }
161
+ .translate(@x; @y) {
162
+ -webkit-transform: translate(@x, @y);
163
+ -ms-transform: translate(@x, @y); // IE9+
164
+ transform: translate(@x, @y);
165
+ }
166
+ .skew(@x; @y) {
167
+ -webkit-transform: skew(@x, @y);
168
+ -ms-transform: skewX(@x) skewY(@y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+
169
+ transform: skew(@x, @y);
170
+ }
171
+ .translate3d(@x; @y; @z) {
172
+ -webkit-transform: translate3d(@x, @y, @z);
173
+ transform: translate3d(@x, @y, @z);
174
+ }
175
+
176
+ .rotateX(@degrees) {
177
+ -webkit-transform: rotateX(@degrees);
178
+ -ms-transform: rotateX(@degrees); // IE9+
179
+ transform: rotateX(@degrees);
180
+ }
181
+ .rotateY(@degrees) {
182
+ -webkit-transform: rotateY(@degrees);
183
+ -ms-transform: rotateY(@degrees); // IE9+
184
+ transform: rotateY(@degrees);
185
+ }
186
+ .perspective(@perspective) {
187
+ -webkit-perspective: @perspective;
188
+ -moz-perspective: @perspective;
189
+ perspective: @perspective;
190
+ }
191
+ .perspective-origin(@perspective) {
192
+ -webkit-perspective-origin: @perspective;
193
+ -moz-perspective-origin: @perspective;
194
+ perspective-origin: @perspective;
195
+ }
196
+ .transform-origin(@origin) {
197
+ -webkit-transform-origin: @origin;
198
+ -moz-transform-origin: @origin;
199
+ transform-origin: @origin;
200
+ }
201
+
202
+ // Animations
203
+ .animation(@animation) {
204
+ -webkit-animation: @animation;
205
+ animation: @animation;
206
+ }
207
+
208
+ // Backface visibility
209
+ // Prevent browsers from flickering when using CSS 3D transforms.
210
+ // Default value is `visible`, but can be changed to `hidden`
211
+ .backface-visibility(@visibility){
212
+ -webkit-backface-visibility: @visibility;
213
+ -moz-backface-visibility: @visibility;
214
+ backface-visibility: @visibility;
215
+ }
216
+
217
+ // Box sizing
218
+ .box-sizing(@boxmodel) {
219
+ -webkit-box-sizing: @boxmodel;
220
+ -moz-box-sizing: @boxmodel;
221
+ box-sizing: @boxmodel;
222
+ }
223
+
224
+ // User select
225
+ // For selecting text on the page
226
+ .user-select(@select) {
227
+ -webkit-user-select: @select;
228
+ -moz-user-select: @select;
229
+ -ms-user-select: @select; // IE10+
230
+ -o-user-select: @select;
231
+ user-select: @select;
232
+ }
233
+
234
+ // Resize anything
235
+ .resizable(@direction) {
236
+ resize: @direction; // Options: horizontal, vertical, both
237
+ overflow: auto; // Safari fix
238
+ }
239
+
240
+ // CSS3 Content Columns
241
+ .content-columns(@column-count; @column-gap: @grid-gutter-width) {
242
+ -webkit-column-count: @column-count;
243
+ -moz-column-count: @column-count;
244
+ column-count: @column-count;
245
+ -webkit-column-gap: @column-gap;
246
+ -moz-column-gap: @column-gap;
247
+ column-gap: @column-gap;
248
+ }
249
+
250
+ // Optional hyphenation
251
+ .hyphens(@mode: auto) {
252
+ word-wrap: break-word;
253
+ -webkit-hyphens: @mode;
254
+ -moz-hyphens: @mode;
255
+ -ms-hyphens: @mode; // IE10+
256
+ -o-hyphens: @mode;
257
+ hyphens: @mode;
258
+ }
259
+
260
+ // Opacity
261
+ .opacity(@opacity) {
262
+ opacity: @opacity;
263
+ // IE8 filter
264
+ @opacity-ie: (@opacity * 100);
265
+ filter: ~"alpha(opacity=@{opacity-ie})";
266
+ }
267
+
268
+
269
+
270
+ // GRADIENTS
271
+ // --------------------------------------------------
272
+
273
+ #gradient {
274
+
275
+ // Horizontal gradient, from left to right
276
+ //
277
+ // Creates two color stops, start and end, by specifying a color and position for each color stop.
278
+ // Color stops are not available in IE9 and below.
279
+ .horizontal(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) {
280
+ background-image: -webkit-linear-gradient(left, color-stop(@start-color @start-percent), color-stop(@end-color @end-percent)); // Safari 5.1-6, Chrome 10+
281
+ background-image: linear-gradient(to right, @start-color @start-percent, @end-color @end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+
282
+ background-repeat: repeat-x;
283
+ filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",argb(@start-color),argb(@end-color))); // IE9 and down
284
+ }
285
+
286
+ // Vertical gradient, from top to bottom
287
+ //
288
+ // Creates two color stops, start and end, by specifying a color and position for each color stop.
289
+ // Color stops are not available in IE9 and below.
290
+ .vertical(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) {
291
+ background-image: -webkit-linear-gradient(top, @start-color @start-percent, @end-color @end-percent); // Safari 5.1-6, Chrome 10+
292
+ background-image: linear-gradient(to bottom, @start-color @start-percent, @end-color @end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+
293
+ background-repeat: repeat-x;
294
+ filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@start-color),argb(@end-color))); // IE9 and down
295
+ }
296
+
297
+ .directional(@start-color: #555; @end-color: #333; @deg: 45deg) {
298
+ background-repeat: repeat-x;
299
+ background-image: -webkit-linear-gradient(@deg, @start-color, @end-color); // Safari 5.1-6, Chrome 10+
300
+ background-image: linear-gradient(@deg, @start-color, @end-color); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+
301
+ }
302
+ .horizontal-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) {
303
+ background-image: -webkit-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color);
304
+ background-image: linear-gradient(to right, @start-color, @mid-color @color-stop, @end-color);
305
+ background-repeat: no-repeat;
306
+ 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
307
+ }
308
+ .vertical-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) {
309
+ background-image: -webkit-linear-gradient(@start-color, @mid-color @color-stop, @end-color);
310
+ background-image: linear-gradient(@start-color, @mid-color @color-stop, @end-color);
311
+ background-repeat: no-repeat;
312
+ 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
313
+ }
314
+ .radial(@inner-color: #555; @outer-color: #333) {
315
+ background-image: -webkit-radial-gradient(circle, @inner-color, @outer-color);
316
+ background-image: radial-gradient(circle, @inner-color, @outer-color);
317
+ background-repeat: no-repeat;
318
+ }
319
+ .striped(@color: rgba(255,255,255,.15); @angle: 45deg) {
320
+ background-image: -webkit-linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);
321
+ background-image: linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);
322
+ }
323
+ }
324
+
325
+ // Reset filters for IE
326
+ //
327
+ // When you need to remove a gradient background, do not forget to use this to reset
328
+ // the IE filter for IE9 and below.
329
+ .reset-filter() {
330
+ filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)"));
331
+ }
332
+
333
+
334
+
335
+ // Retina images
336
+ //
337
+ // Short retina mixin for setting background-image and -size
338
+
339
+ .img-retina(@file-1x; @file-2x; @width-1x; @height-1x) {
340
+ background-image: asset-url("@{file-1x}");
341
+
342
+ @media
343
+ only screen and (-webkit-min-device-pixel-ratio: 2),
344
+ only screen and ( min--moz-device-pixel-ratio: 2),
345
+ only screen and ( -o-min-device-pixel-ratio: 2/1),
346
+ only screen and ( min-device-pixel-ratio: 2),
347
+ only screen and ( min-resolution: 192dpi),
348
+ only screen and ( min-resolution: 2dppx) {
349
+ background-image: asset-url("@{file-2x}");
350
+ background-size: @width-1x @height-1x;
351
+ }
352
+ }
353
+
354
+
355
+ // Responsive image
356
+ //
357
+ // Keep images from scaling beyond the width of their parents.
358
+
359
+ .img-responsive(@display: block;) {
360
+ display: @display;
361
+ max-width: 100%; // Part 1: Set a maximum relative to the parent
362
+ height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching
363
+ }
364
+
365
+
366
+ // COMPONENT MIXINS
367
+ // --------------------------------------------------
368
+
369
+ // Horizontal dividers
370
+ // -------------------------
371
+ // Dividers (basically an hr) within dropdowns and nav lists
372
+ .nav-divider(@color: #e5e5e5) {
373
+ height: 1px;
374
+ margin: ((@line-height-computed / 2) - 1) 0;
375
+ overflow: hidden;
376
+ background-color: @color;
377
+ }
378
+
379
+ // Panels
380
+ // -------------------------
381
+ .panel-variant(@border; @heading-text-color; @heading-bg-color; @heading-border) {
382
+ border-color: @border;
383
+
384
+ & > .panel-heading {
385
+ color: @heading-text-color;
386
+ background-color: @heading-bg-color;
387
+ border-color: @heading-border;
388
+
389
+ + .panel-collapse .panel-body {
390
+ border-top-color: @border;
391
+ }
392
+ }
393
+ & > .panel-footer {
394
+ + .panel-collapse .panel-body {
395
+ border-bottom-color: @border;
396
+ }
397
+ }
398
+ }
399
+
400
+ // Alerts
401
+ // -------------------------
402
+ .alert-variant(@background; @border; @text-color) {
403
+ background-color: @background;
404
+ border-color: @border;
405
+ color: @text-color;
406
+
407
+ hr {
408
+ border-top-color: darken(@border, 5%);
409
+ }
410
+ .alert-link {
411
+ color: darken(@text-color, 10%);
412
+ }
413
+ }
414
+
415
+ // Tables
416
+ // -------------------------
417
+ .table-row-variant(@state; @background) {
418
+ // Exact selectors below required to override `.table-striped` and prevent
419
+ // inheritance to nested tables.
420
+ .table {
421
+ > thead,
422
+ > tbody,
423
+ > tfoot {
424
+ > tr > .@{state},
425
+ > .@{state} > td,
426
+ > .@{state} > th {
427
+ background-color: @background;
428
+ }
429
+ }
430
+ }
431
+
432
+ // Hover states for `.table-hover`
433
+ // Note: this is not available for cells or rows within `thead` or `tfoot`.
434
+ .table-hover > tbody {
435
+ > tr > .@{state}:hover,
436
+ > .@{state}:hover > td,
437
+ > .@{state}:hover > th {
438
+ background-color: darken(@background, 5%);
439
+ }
440
+ }
441
+ }
442
+
443
+ // Button variants
444
+ // -------------------------
445
+ // Easily pump out default styles, as well as :hover, :focus, :active,
446
+ // and disabled options for all buttons
447
+ .button-variant(@color; @background; @border) {
448
+ color: @color;
449
+ background-color: @background;
450
+ border-color: @border;
451
+
452
+ &:hover,
453
+ &:focus,
454
+ &:active,
455
+ &.active,
456
+ .open .dropdown-toggle& {
457
+ color: @color;
458
+ background-color: darken(@background, 8%);
459
+ border-color: darken(@border, 12%);
460
+ }
461
+ &:active,
462
+ &.active,
463
+ .open .dropdown-toggle& {
464
+ background-image: none;
465
+ }
466
+ &.disabled,
467
+ &[disabled],
468
+ fieldset[disabled] & {
469
+ &,
470
+ &:hover,
471
+ &:focus,
472
+ &:active,
473
+ &.active {
474
+ background-color: @background;
475
+ border-color: @border;
476
+ }
477
+ }
478
+
479
+ .badge {
480
+ color: @background;
481
+ background-color: #fff;
482
+ }
483
+ }
484
+
485
+ // Button sizes
486
+ // -------------------------
487
+ .button-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) {
488
+ padding: @padding-vertical @padding-horizontal;
489
+ font-size: @font-size;
490
+ line-height: @line-height;
491
+ border-radius: @border-radius;
492
+ }
493
+
494
+ // Pagination
495
+ // -------------------------
496
+ .pagination-size(@padding-vertical; @padding-horizontal; @font-size; @border-radius) {
497
+ > li {
498
+ > a,
499
+ > span {
500
+ padding: @padding-vertical @padding-horizontal;
501
+ font-size: @font-size;
502
+ }
503
+ &:first-child {
504
+ > a,
505
+ > span {
506
+ .border-left-radius(@border-radius);
507
+ }
508
+ }
509
+ &:last-child {
510
+ > a,
511
+ > span {
512
+ .border-right-radius(@border-radius);
513
+ }
514
+ }
515
+ }
516
+ }
517
+
518
+ // Labels
519
+ // -------------------------
520
+ .label-variant(@color) {
521
+ background-color: @color;
522
+ &[href] {
523
+ &:hover,
524
+ &:focus {
525
+ background-color: darken(@color, 10%);
526
+ }
527
+ }
528
+ }
529
+
530
+ // Navbar vertical align
531
+ // -------------------------
532
+ // Vertically center elements in the navbar.
533
+ // Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin.
534
+ .navbar-vertical-align(@element-height) {
535
+ margin-top: ((@navbar-height - @element-height) / 2);
536
+ margin-bottom: ((@navbar-height - @element-height) / 2);
537
+ }
538
+
539
+ // Progress bars
540
+ // -------------------------
541
+ .progress-bar-variant(@color) {
542
+ background-color: @color;
543
+ .progress-striped & {
544
+ #gradient > .striped();
545
+ }
546
+ }
547
+
548
+ // Responsive utilities
549
+ // -------------------------
550
+ // More easily include all the states for responsive-utilities.less.
551
+ .responsive-visibility() {
552
+ display: block !important;
553
+ table& { display: table; }
554
+ tr& { display: table-row !important; }
555
+ th&,
556
+ td& { display: table-cell !important; }
557
+ }
558
+
559
+ .responsive-invisibility() {
560
+ &,
561
+ tr&,
562
+ th&,
563
+ td& { display: none !important; }
564
+ }
565
+
566
+
567
+ // Grid System
568
+ // -----------
569
+
570
+ // Centered container element
571
+ .container-fixed() {
572
+ margin-right: auto;
573
+ margin-left: auto;
574
+ padding-left: (@grid-gutter-width / 2);
575
+ padding-right: (@grid-gutter-width / 2);
576
+ .clearfix();
577
+ }
578
+
579
+ // Creates a wrapper for a series of columns
580
+ .make-row(@gutter: @grid-gutter-width) {
581
+ margin-left: (@gutter / -2);
582
+ margin-right: (@gutter / -2);
583
+ .clearfix();
584
+ }
585
+
586
+ // Generate the extra small columns
587
+ .make-xs-column(@columns; @gutter: @grid-gutter-width) {
588
+ position: relative;
589
+ float: left;
590
+ width: percentage((@columns / @grid-columns));
591
+ // Prevent columns from collapsing when empty
592
+ min-height: 1px;
593
+ // Inner gutter via padding
594
+ padding-left: (@gutter / 2);
595
+ padding-right: (@gutter / 2);
596
+ }
597
+
598
+ // Generate the small columns
599
+ .make-sm-column(@columns; @gutter: @grid-gutter-width) {
600
+ position: relative;
601
+ // Prevent columns from collapsing when empty
602
+ min-height: 1px;
603
+ // Inner gutter via padding
604
+ padding-left: (@gutter / 2);
605
+ padding-right: (@gutter / 2);
606
+
607
+ // Calculate width based on number of columns available
608
+ @media (min-width: @screen-sm-min) {
609
+ float: left;
610
+ width: percentage((@columns / @grid-columns));
611
+ }
612
+ }
613
+
614
+ // Generate the small column offsets
615
+ .make-sm-column-offset(@columns) {
616
+ @media (min-width: @screen-sm-min) {
617
+ margin-left: percentage((@columns / @grid-columns));
618
+ }
619
+ }
620
+ .make-sm-column-push(@columns) {
621
+ @media (min-width: @screen-sm-min) {
622
+ left: percentage((@columns / @grid-columns));
623
+ }
624
+ }
625
+ .make-sm-column-pull(@columns) {
626
+ @media (min-width: @screen-sm-min) {
627
+ right: percentage((@columns / @grid-columns));
628
+ }
629
+ }
630
+
631
+ // Generate the medium columns
632
+ .make-md-column(@columns; @gutter: @grid-gutter-width) {
633
+ position: relative;
634
+ // Prevent columns from collapsing when empty
635
+ min-height: 1px;
636
+ // Inner gutter via padding
637
+ padding-left: (@gutter / 2);
638
+ padding-right: (@gutter / 2);
639
+
640
+ // Calculate width based on number of columns available
641
+ @media (min-width: @screen-md-min) {
642
+ float: left;
643
+ width: percentage((@columns / @grid-columns));
644
+ }
645
+ }
646
+
647
+ // Generate the medium column offsets
648
+ .make-md-column-offset(@columns) {
649
+ @media (min-width: @screen-md-min) {
650
+ margin-left: percentage((@columns / @grid-columns));
651
+ }
652
+ }
653
+ .make-md-column-push(@columns) {
654
+ @media (min-width: @screen-md) {
655
+ left: percentage((@columns / @grid-columns));
656
+ }
657
+ }
658
+ .make-md-column-pull(@columns) {
659
+ @media (min-width: @screen-md-min) {
660
+ right: percentage((@columns / @grid-columns));
661
+ }
662
+ }
663
+
664
+ // Generate the large columns
665
+ .make-lg-column(@columns; @gutter: @grid-gutter-width) {
666
+ position: relative;
667
+ // Prevent columns from collapsing when empty
668
+ min-height: 1px;
669
+ // Inner gutter via padding
670
+ padding-left: (@gutter / 2);
671
+ padding-right: (@gutter / 2);
672
+
673
+ // Calculate width based on number of columns available
674
+ @media (min-width: @screen-lg-min) {
675
+ float: left;
676
+ width: percentage((@columns / @grid-columns));
677
+ }
678
+ }
679
+
680
+ // Generate the large column offsets
681
+ .make-lg-column-offset(@columns) {
682
+ @media (min-width: @screen-lg-min) {
683
+ margin-left: percentage((@columns / @grid-columns));
684
+ }
685
+ }
686
+ .make-lg-column-push(@columns) {
687
+ @media (min-width: @screen-lg-min) {
688
+ left: percentage((@columns / @grid-columns));
689
+ }
690
+ }
691
+ .make-lg-column-pull(@columns) {
692
+ @media (min-width: @screen-lg-min) {
693
+ right: percentage((@columns / @grid-columns));
694
+ }
695
+ }
696
+
697
+
698
+ // Framework grid generation
699
+ //
700
+ // Used only by Bootstrap to generate the correct number of grid classes given
701
+ // any value of `@grid-columns`.
702
+
703
+ .make-grid-columns() {
704
+ // Common styles for all sizes of grid columns, widths 1-12
705
+ .col(@index) when (@index = 1) { // initial
706
+ @item: ~".col-xs-@{index}, .col-sm-@{index}, .col-md-@{index}, .col-lg-@{index}";
707
+ .col(@index + 1, @item);
708
+ }
709
+ .col(@index, @list) when (@index =< @grid-columns) { // general; "=<" isn't a typo
710
+ @item: ~".col-xs-@{index}, .col-sm-@{index}, .col-md-@{index}, .col-lg-@{index}";
711
+ .col(@index + 1, ~"@{list}, @{item}");
712
+ }
713
+ .col(@index, @list) when (@index > @grid-columns) { // terminal
714
+ @{list} {
715
+ position: relative;
716
+ // Prevent columns from collapsing when empty
717
+ min-height: 1px;
718
+ // Inner gutter via padding
719
+ padding-left: (@grid-gutter-width / 2);
720
+ padding-right: (@grid-gutter-width / 2);
721
+ }
722
+ }
723
+ .col(1); // kickstart it
724
+ }
725
+
726
+ .make-grid-columns-float(@class) {
727
+ .col(@index) when (@index = 1) { // initial
728
+ @item: ~".col-@{class}-@{index}";
729
+ .col(@index + 1, @item);
730
+ }
731
+ .col(@index, @list) when (@index =< @grid-columns) { // general
732
+ @item: ~".col-@{class}-@{index}";
733
+ .col(@index + 1, ~"@{list}, @{item}");
734
+ }
735
+ .col(@index, @list) when (@index > @grid-columns) { // terminal
736
+ @{list} {
737
+ float: left;
738
+ }
739
+ }
740
+ .col(1); // kickstart it
741
+ }
742
+
743
+ .calc-grid(@index, @class, @type) when (@type = width) and (@index > 0) {
744
+ .col-@{class}-@{index} {
745
+ width: percentage((@index / @grid-columns));
746
+ }
747
+ }
748
+ .calc-grid(@index, @class, @type) when (@type = push) {
749
+ .col-@{class}-push-@{index} {
750
+ left: percentage((@index / @grid-columns));
751
+ }
752
+ }
753
+ .calc-grid(@index, @class, @type) when (@type = pull) {
754
+ .col-@{class}-pull-@{index} {
755
+ right: percentage((@index / @grid-columns));
756
+ }
757
+ }
758
+ .calc-grid(@index, @class, @type) when (@type = offset) {
759
+ .col-@{class}-offset-@{index} {
760
+ margin-left: percentage((@index / @grid-columns));
761
+ }
762
+ }
763
+
764
+ // Basic looping in LESS
765
+ .make-grid(@index, @class, @type) when (@index >= 0) {
766
+ .calc-grid(@index, @class, @type);
767
+ // next iteration
768
+ .make-grid(@index - 1, @class, @type);
769
+ }
770
+
771
+
772
+ // Form validation states
773
+ //
774
+ // Used in forms.less to generate the form validation CSS for warnings, errors,
775
+ // and successes.
776
+
777
+ .form-control-validation(@text-color: #555; @border-color: #ccc; @background-color: #f5f5f5) {
778
+ // Color the label and help text
779
+ .help-block,
780
+ .control-label,
781
+ .radio,
782
+ .checkbox,
783
+ .radio-inline,
784
+ .checkbox-inline {
785
+ color: @text-color;
786
+ }
787
+ // Set the border and box shadow on specific inputs to match
788
+ .form-control {
789
+ border-color: @border-color;
790
+ .box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work
791
+ &:focus {
792
+ border-color: darken(@border-color, 10%);
793
+ @shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@border-color, 20%);
794
+ .box-shadow(@shadow);
795
+ }
796
+ }
797
+ // Set validation states also for addons
798
+ .input-group-addon {
799
+ color: @text-color;
800
+ border-color: @border-color;
801
+ background-color: @background-color;
802
+ }
803
+ }
804
+
805
+ // Form control focus state
806
+ //
807
+ // Generate a customized focus state and for any input with the specified color,
808
+ // which defaults to the `@input-focus-border` variable.
809
+ //
810
+ // We highly encourage you to not customize the default value, but instead use
811
+ // this to tweak colors on an as-needed basis. This aesthetic change is based on
812
+ // WebKit's default styles, but applicable to a wider range of browsers. Its
813
+ // usability and accessibility should be taken into account with any change.
814
+ //
815
+ // Example usage: change the default blue border and shadow to white for better
816
+ // contrast against a dark gray background.
817
+
818
+ .form-control-focus(@color: @input-border-focus) {
819
+ @color-rgba: rgba(red(@color), green(@color), blue(@color), .6);
820
+ &:focus {
821
+ border-color: @color;
822
+ outline: 0;
823
+ .box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px @{color-rgba}");
824
+ }
825
+ }
826
+
827
+ // Form control sizing
828
+ //
829
+ // Relative text size, padding, and border-radii changes for form controls. For
830
+ // horizontal sizing, wrap controls in the predefined grid classes. `<select>`
831
+ // element gets special love because it's special, and that's a fact!
832
+
833
+ .input-size(@input-height; @padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) {
834
+ height: @input-height;
835
+ padding: @padding-vertical @padding-horizontal;
836
+ font-size: @font-size;
837
+ line-height: @line-height;
838
+ border-radius: @border-radius;
839
+
840
+ select& {
841
+ height: @input-height;
842
+ line-height: @input-height;
843
+ }
844
+
845
+ textarea& {
846
+ height: auto;
847
+ }
848
+ }