twbs_less_rails 1.0.2

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