twbs_sass_rails 0.2.0 → 0.3.1

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