bootstrap-sass 2.3.1.3 → 3.0.0.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of bootstrap-sass might be problematic. Click here for more details.

Files changed (147) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +15 -0
  3. data/.travis.yml +12 -0
  4. data/CHANGELOG.md +104 -0
  5. data/CONTRIBUTING.md +79 -0
  6. data/Gemfile +3 -0
  7. data/README.md +114 -78
  8. data/Rakefile +48 -0
  9. data/bootstrap-sass.gemspec +28 -0
  10. data/lib/bootstrap-sass/engine.rb +4 -2
  11. data/lib/bootstrap-sass/version.rb +4 -0
  12. data/lib/bootstrap-sass.rb +10 -5
  13. data/tasks/converter.rb +829 -0
  14. data/templates/project/_variables.scss.erb +3 -0
  15. data/templates/project/manifest.rb +10 -13
  16. data/templates/project/styles.scss +1 -6
  17. data/test/compass_test.rb +8 -0
  18. data/test/compilation_test.rb +13 -0
  19. data/test/dummy/README.rdoc +3 -0
  20. data/test/dummy/Rakefile +6 -0
  21. data/test/dummy/app/assets/images/.keep +0 -0
  22. data/test/dummy/app/assets/javascripts/application.js +2 -0
  23. data/test/dummy/app/assets/stylesheets/application.css.sass +1 -0
  24. data/test/dummy/app/controllers/application_controller.rb +5 -0
  25. data/test/dummy/app/controllers/pages_controller.rb +4 -0
  26. data/test/dummy/app/helpers/application_helper.rb +2 -0
  27. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  28. data/test/dummy/app/views/pages/root.html.slim +11 -0
  29. data/test/dummy/bin/bundle +3 -0
  30. data/test/dummy/bin/rails +4 -0
  31. data/test/dummy/bin/rake +4 -0
  32. data/test/dummy/config/application.rb +17 -0
  33. data/test/dummy/config/boot.rb +5 -0
  34. data/test/dummy/config/environment.rb +5 -0
  35. data/test/dummy/config/environments/development.rb +26 -0
  36. data/test/dummy/config/environments/production.rb +76 -0
  37. data/test/dummy/config/environments/test.rb +30 -0
  38. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  39. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  40. data/test/dummy/config/initializers/inflections.rb +16 -0
  41. data/test/dummy/config/initializers/mime_types.rb +5 -0
  42. data/test/dummy/config/initializers/secret_token.rb +18 -0
  43. data/test/dummy/config/initializers/session_store.rb +3 -0
  44. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  45. data/test/dummy/config/locales/en.yml +3 -0
  46. data/test/dummy/config/locales/es.yml +3 -0
  47. data/test/dummy/config/routes.rb +3 -0
  48. data/test/dummy/config.ru +4 -0
  49. data/test/dummy/db/test.sqlite3 +0 -0
  50. data/test/dummy/lib/assets/.keep +0 -0
  51. data/test/dummy/log/.keep +0 -0
  52. data/test/dummy/log/development.log +0 -0
  53. data/test/dummy/public/404.html +58 -0
  54. data/test/dummy/public/422.html +58 -0
  55. data/test/dummy/public/500.html +57 -0
  56. data/test/dummy/public/favicon.ico +0 -0
  57. data/test/gemfiles/sass_3_2.gemfile +5 -0
  58. data/test/gemfiles/sass_head.gemfile +6 -0
  59. data/test/pages_test.rb +14 -0
  60. data/test/support/integration_test.rb +29 -0
  61. data/test/test_helper.rb +32 -0
  62. data/vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.eot +0 -0
  63. data/vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.svg +228 -0
  64. data/vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf +0 -0
  65. data/vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.woff +0 -0
  66. data/vendor/assets/javascripts/bootstrap/affix.js +126 -0
  67. data/vendor/assets/javascripts/bootstrap/alert.js +98 -0
  68. data/vendor/assets/javascripts/bootstrap/button.js +109 -0
  69. data/vendor/assets/javascripts/bootstrap/carousel.js +217 -0
  70. data/vendor/assets/javascripts/bootstrap/collapse.js +179 -0
  71. data/vendor/assets/javascripts/bootstrap/dropdown.js +154 -0
  72. data/vendor/assets/javascripts/bootstrap/modal.js +246 -0
  73. data/vendor/assets/javascripts/bootstrap/popover.js +117 -0
  74. data/vendor/assets/javascripts/bootstrap/scrollspy.js +158 -0
  75. data/vendor/assets/javascripts/bootstrap/tab.js +135 -0
  76. data/vendor/assets/javascripts/bootstrap/tooltip.js +386 -0
  77. data/vendor/assets/javascripts/bootstrap/transition.js +56 -0
  78. data/vendor/assets/javascripts/bootstrap.js +12 -13
  79. data/vendor/assets/stylesheets/bootstrap/_alerts.scss +46 -58
  80. data/vendor/assets/stylesheets/bootstrap/_badges.scss +51 -0
  81. data/vendor/assets/stylesheets/bootstrap/_breadcrumbs.scss +8 -9
  82. data/vendor/assets/stylesheets/bootstrap/_button-groups.scss +173 -154
  83. data/vendor/assets/stylesheets/bootstrap/_buttons.scss +97 -165
  84. data/vendor/assets/stylesheets/bootstrap/_carousel.scss +116 -65
  85. data/vendor/assets/stylesheets/bootstrap/_close.scss +11 -8
  86. data/vendor/assets/stylesheets/bootstrap/_code.scss +16 -21
  87. data/vendor/assets/stylesheets/bootstrap/_component-animations.scss +10 -3
  88. data/vendor/assets/stylesheets/bootstrap/_dropdowns.scss +103 -146
  89. data/vendor/assets/stylesheets/bootstrap/_forms.scss +222 -559
  90. data/vendor/assets/stylesheets/bootstrap/_glyphicons.scss +232 -0
  91. data/vendor/assets/stylesheets/bootstrap/_grid.scss +336 -11
  92. data/vendor/assets/stylesheets/bootstrap/_input-groups.scss +127 -0
  93. data/vendor/assets/stylesheets/bootstrap/_jumbotron.scss +40 -0
  94. data/vendor/assets/stylesheets/bootstrap/_labels.scss +58 -0
  95. data/vendor/assets/stylesheets/bootstrap/_list-group.scss +90 -0
  96. data/vendor/assets/stylesheets/bootstrap/_media.scss +8 -7
  97. data/vendor/assets/stylesheets/bootstrap/_mixins.scss +470 -430
  98. data/vendor/assets/stylesheets/bootstrap/_modals.scss +103 -52
  99. data/vendor/assets/stylesheets/bootstrap/_navbar.scss +511 -383
  100. data/vendor/assets/stylesheets/bootstrap/_navs.scss +169 -349
  101. data/vendor/assets/stylesheets/bootstrap/_normalize.scss +396 -0
  102. data/vendor/assets/stylesheets/bootstrap/_pager.scss +45 -33
  103. data/vendor/assets/stylesheets/bootstrap/_pagination.scss +65 -105
  104. data/vendor/assets/stylesheets/bootstrap/_panels.scss +148 -0
  105. data/vendor/assets/stylesheets/bootstrap/_popovers.scss +51 -51
  106. data/vendor/assets/stylesheets/bootstrap/_print.scss +100 -0
  107. data/vendor/assets/stylesheets/bootstrap/_progress-bars.scss +28 -55
  108. data/vendor/assets/stylesheets/bootstrap/_responsive-utilities.scss +180 -45
  109. data/vendor/assets/stylesheets/bootstrap/_scaffolding.scss +101 -24
  110. data/vendor/assets/stylesheets/bootstrap/_tables.scss +169 -168
  111. data/vendor/assets/stylesheets/bootstrap/_theme.scss +232 -0
  112. data/vendor/assets/stylesheets/bootstrap/_thumbnails.scss +11 -33
  113. data/vendor/assets/stylesheets/bootstrap/_tooltip.scss +45 -20
  114. data/vendor/assets/stylesheets/bootstrap/_type.scss +101 -110
  115. data/vendor/assets/stylesheets/bootstrap/_utilities.scss +19 -22
  116. data/vendor/assets/stylesheets/bootstrap/_variables.scss +498 -179
  117. data/vendor/assets/stylesheets/bootstrap/_wells.scss +7 -7
  118. data/vendor/assets/stylesheets/bootstrap/bootstrap.scss +29 -33
  119. metadata +226 -44
  120. data/templates/project/_variables.scss +0 -301
  121. data/vendor/assets/images/glyphicons-halflings-white.png +0 -0
  122. data/vendor/assets/images/glyphicons-halflings.png +0 -0
  123. data/vendor/assets/javascripts/bootstrap-affix.js +0 -117
  124. data/vendor/assets/javascripts/bootstrap-alert.js +0 -99
  125. data/vendor/assets/javascripts/bootstrap-button.js +0 -105
  126. data/vendor/assets/javascripts/bootstrap-carousel.js +0 -207
  127. data/vendor/assets/javascripts/bootstrap-collapse.js +0 -167
  128. data/vendor/assets/javascripts/bootstrap-dropdown.js +0 -165
  129. data/vendor/assets/javascripts/bootstrap-modal.js +0 -247
  130. data/vendor/assets/javascripts/bootstrap-popover.js +0 -114
  131. data/vendor/assets/javascripts/bootstrap-scrollspy.js +0 -162
  132. data/vendor/assets/javascripts/bootstrap-tab.js +0 -144
  133. data/vendor/assets/javascripts/bootstrap-tooltip.js +0 -361
  134. data/vendor/assets/javascripts/bootstrap-transition.js +0 -60
  135. data/vendor/assets/javascripts/bootstrap-typeahead.js +0 -335
  136. data/vendor/assets/stylesheets/bootstrap/_accordion.scss +0 -34
  137. data/vendor/assets/stylesheets/bootstrap/_hero-unit.scss +0 -25
  138. data/vendor/assets/stylesheets/bootstrap/_labels-badges.scss +0 -83
  139. data/vendor/assets/stylesheets/bootstrap/_layouts.scss +0 -16
  140. data/vendor/assets/stylesheets/bootstrap/_reset.scss +0 -216
  141. data/vendor/assets/stylesheets/bootstrap/_responsive-1200px-min.scss +0 -28
  142. data/vendor/assets/stylesheets/bootstrap/_responsive-767px-max.scss +0 -193
  143. data/vendor/assets/stylesheets/bootstrap/_responsive-768px-979px.scss +0 -19
  144. data/vendor/assets/stylesheets/bootstrap/_responsive-navbar.scss +0 -189
  145. data/vendor/assets/stylesheets/bootstrap/_sprites.scss +0 -197
  146. data/vendor/assets/stylesheets/bootstrap/responsive.scss +0 -48
  147. data/vendor/assets/stylesheets/bootstrap-responsive.scss +0 -1
@@ -3,21 +3,24 @@
3
3
  // --------------------------------------------------
4
4
 
5
5
 
6
- // UTILITY MIXINS
7
- // --------------------------------------------------
6
+ // Utilities
7
+ // -------------------------
8
8
 
9
9
  // Clearfix
10
- // --------
11
- // For clearing floats like a boss h5bp.com/q
12
- @mixin clearfix {
13
- *zoom: 1;
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() {
14
20
  &:before,
15
21
  &:after {
16
- display: table;
17
- content: "";
18
- // Fixes Opera/contenteditable bug:
19
- // http://nicolasgallagher.com/micro-clearfix-hack/#comment-36952
20
- line-height: 0;
22
+ content: " "; /* 1 */
23
+ display: table; /* 2 */
21
24
  }
22
25
  &:after {
23
26
  clear: both;
@@ -25,7 +28,6 @@
25
28
  }
26
29
 
27
30
  // Webkit-style focus
28
- // ------------------
29
31
  @mixin tab-focus() {
30
32
  // Default
31
33
  outline: thin dotted #333;
@@ -35,41 +37,14 @@
35
37
  }
36
38
 
37
39
  // Center-align a block level element
38
- // ----------------------------------
39
40
  @mixin center-block() {
40
41
  display: block;
41
42
  margin-left: auto;
42
43
  margin-right: auto;
43
44
  }
44
45
 
45
- // IE7 inline-block
46
- // ----------------
47
- @mixin ie7-inline-block() {
48
- *display: inline; /* IE7 inline-block hack */
49
- *zoom: 1;
50
- }
51
-
52
- // IE7 likes to collapse whitespace on either side of the inline-block elements.
53
- // Ems because we're attempting to match the width of a space character. Left
54
- // version is for form buttons, which typically come after other elements, and
55
- // right version is for icons, which come before. Applying both is ok, but it will
56
- // mean that space between those elements will be .6em (~2 space characters) in IE7,
57
- // instead of the 1 space in other browsers.
58
- @mixin ie7-restore-left-whitespace() {
59
- *margin-left: .3em;
60
-
61
- &:first-child {
62
- *margin-left: 0;
63
- }
64
- }
65
-
66
- @mixin ie7-restore-right-whitespace() {
67
- *margin-right: .3em;
68
- }
69
-
70
46
  // Sizing shortcuts
71
- // -------------------------
72
- @mixin size($height, $width) {
47
+ @mixin size($width, $height) {
73
48
  width: $width;
74
49
  height: $height;
75
50
  }
@@ -78,21 +53,14 @@
78
53
  }
79
54
 
80
55
  // Placeholder text
81
- // -------------------------
82
- @mixin placeholder($color: $placeholderText) {
83
- &:-moz-placeholder {
84
- color: $color;
85
- }
86
- &:-ms-input-placeholder {
87
- color: $color;
88
- }
89
- &::-webkit-input-placeholder {
90
- color: $color;
91
- }
56
+ @mixin 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
92
61
  }
93
62
 
94
63
  // Text overflow
95
- // -------------------------
96
64
  // Requires inline-block or block for proper styling
97
65
  @mixin text-overflow() {
98
66
  overflow: hidden;
@@ -101,10 +69,9 @@
101
69
  }
102
70
 
103
71
  // CSS image replacement
104
- // -------------------------
105
72
  // Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757
106
- @mixin hide-text {
107
- font: 0/0 a;
73
+ @mixin hide-text() {
74
+ font: #{0/0} a;
108
75
  color: transparent;
109
76
  text-shadow: none;
110
77
  background-color: transparent;
@@ -112,204 +79,83 @@
112
79
  }
113
80
 
114
81
 
115
- // FONTS
116
- // --------------------------------------------------
117
-
118
- @mixin font-family-serif() {
119
- font-family: $serifFontFamily;
120
- }
121
- @mixin font-family-sans-serif() {
122
- font-family: $sansFontFamily;
123
- }
124
- @mixin font-family-monospace() {
125
- font-family: $monoFontFamily;
126
- }
127
- @mixin font-shorthand($size: $baseFontSize, $weight: normal, $lineHeight: $baseLineHeight) {
128
- font-size: $size;
129
- font-weight: $weight;
130
- line-height: $lineHeight;
131
- }
132
- @mixin font-serif($size: $baseFontSize, $weight: normal, $lineHeight: $baseLineHeight) {
133
- @include font-family-serif();
134
- @include font-shorthand($size, $weight, $lineHeight);
135
- }
136
- @mixin font-sans-serif($size: $baseFontSize, $weight: normal, $lineHeight: $baseLineHeight) {
137
- @include font-family-sans-serif();
138
- @include font-shorthand($size, $weight, $lineHeight);
139
- }
140
- @mixin font-monospace($size: $baseFontSize, $weight: normal, $lineHeight: $baseLineHeight) {
141
- @include font-family-monospace();
142
- @include font-shorthand($size, $weight, $lineHeight);
143
- }
144
-
145
-
146
- // FORMS
147
- // --------------------------------------------------
148
-
149
- // Block level inputs
150
- @mixin input-block-level {
151
- display: block;
152
- width: 100%;
153
- min-height: $inputHeight; // Make inputs at least the height of their button counterpart (base line-height + padding + border)
154
- @include box-sizing(border-box); // Makes inputs behave like true block-level elements
155
- }
156
-
157
-
158
-
159
- // Mixin for form field states
160
- @mixin formFieldState($textColor: #555, $borderColor: #ccc, $backgroundColor: #f5f5f5) {
161
- // Set the text color
162
- .control-label,
163
- .help-block,
164
- .help-inline {
165
- color: $textColor;
166
- }
167
- // Style inputs accordingly
168
- .checkbox,
169
- .radio,
170
- input,
171
- select,
172
- textarea {
173
- color: $textColor;
174
- }
175
- input,
176
- select,
177
- textarea {
178
- border-color: $borderColor;
179
- @include box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work
180
- &:focus {
181
- border-color: darken($borderColor, 10%);
182
- @include box-shadow(inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten($borderColor, 20%));
183
- }
184
- }
185
- // Give a small background color for input-prepend/-append
186
- .input-prepend .add-on,
187
- .input-append .add-on {
188
- color: $textColor;
189
- background-color: $backgroundColor;
190
- border-color: $textColor;
191
- }
192
- }
193
-
194
-
195
82
 
196
83
  // CSS3 PROPERTIES
197
84
  // --------------------------------------------------
198
85
 
199
- // Border Radius
200
- @mixin border-radius($radius) {
201
- -webkit-border-radius: $radius;
202
- -moz-border-radius: $radius;
203
- border-radius: $radius;
204
- }
205
-
206
- // Single Corner Border Radius
207
- @mixin border-top-left-radius($radius) {
208
- -webkit-border-top-left-radius: $radius;
209
- -moz-border-radius-topleft: $radius;
210
- border-top-left-radius: $radius;
211
- }
212
- @mixin border-top-right-radius($radius) {
213
- -webkit-border-top-right-radius: $radius;
214
- -moz-border-radius-topright: $radius;
215
- border-top-right-radius: $radius;
216
- }
217
- @mixin border-bottom-right-radius($radius) {
218
- -webkit-border-bottom-right-radius: $radius;
219
- -moz-border-radius-bottomright: $radius;
220
- border-bottom-right-radius: $radius;
221
- }
222
- @mixin border-bottom-left-radius($radius) {
223
- -webkit-border-bottom-left-radius: $radius;
224
- -moz-border-radius-bottomleft: $radius;
225
- border-bottom-left-radius: $radius;
226
- }
227
-
228
- // Single Side Border Radius
86
+ // Single side border-radius
229
87
  @mixin border-top-radius($radius) {
230
- @include border-top-right-radius($radius);
231
- @include border-top-left-radius($radius);
88
+ border-top-right-radius: $radius;
89
+ border-top-left-radius: $radius;
232
90
  }
233
91
  @mixin border-right-radius($radius) {
234
- @include border-top-right-radius($radius);
235
- @include border-bottom-right-radius($radius);
92
+ border-bottom-right-radius: $radius;
93
+ border-top-right-radius: $radius;
236
94
  }
237
95
  @mixin border-bottom-radius($radius) {
238
- @include border-bottom-right-radius($radius);
239
- @include border-bottom-left-radius($radius);
96
+ border-bottom-right-radius: $radius;
97
+ border-bottom-left-radius: $radius;
240
98
  }
241
99
  @mixin border-left-radius($radius) {
242
- @include border-top-left-radius($radius);
243
- @include border-bottom-left-radius($radius);
100
+ border-bottom-left-radius: $radius;
101
+ border-top-left-radius: $radius;
244
102
  }
245
103
 
246
104
  // Drop shadows
247
105
  @mixin box-shadow($shadow...) {
248
- -webkit-box-shadow: $shadow;
249
- -moz-box-shadow: $shadow;
106
+ -webkit-box-shadow: $shadow; // iOS <4.3 & Android <4.1
250
107
  box-shadow: $shadow;
251
108
  }
252
109
 
253
110
  // Transitions
254
111
  @mixin transition($transition...) {
255
112
  -webkit-transition: $transition;
256
- -moz-transition: $transition;
257
- -o-transition: $transition;
258
113
  transition: $transition;
259
114
  }
260
115
  @mixin transition-delay($transition-delay) {
261
116
  -webkit-transition-delay: $transition-delay;
262
- -moz-transition-delay: $transition-delay;
263
- -o-transition-delay: $transition-delay;
264
117
  transition-delay: $transition-delay;
265
118
  }
266
119
  @mixin transition-duration($transition-duration) {
267
120
  -webkit-transition-duration: $transition-duration;
268
- -moz-transition-duration: $transition-duration;
269
- -o-transition-duration: $transition-duration;
270
121
  transition-duration: $transition-duration;
271
122
  }
123
+ @mixin transition-transform($transition...) {
124
+ -webkit-transition: -webkit-transform $transition;
125
+ -moz-transition: -moz-transform $transition;
126
+ -o-transition: -o-transform $transition;
127
+ transition: transform $transition;
128
+ }
272
129
 
273
130
  // Transformations
274
131
  @mixin rotate($degrees) {
275
132
  -webkit-transform: rotate($degrees);
276
- -moz-transform: rotate($degrees);
277
- -ms-transform: rotate($degrees);
278
- -o-transform: rotate($degrees);
133
+ -ms-transform: rotate($degrees); // IE9+
279
134
  transform: rotate($degrees);
280
135
  }
281
136
  @mixin scale($ratio) {
282
137
  -webkit-transform: scale($ratio);
283
- -moz-transform: scale($ratio);
284
- -ms-transform: scale($ratio);
285
- -o-transform: scale($ratio);
138
+ -ms-transform: scale($ratio); // IE9+
286
139
  transform: scale($ratio);
287
140
  }
288
141
  @mixin translate($x, $y) {
289
142
  -webkit-transform: translate($x, $y);
290
- -moz-transform: translate($x, $y);
291
- -ms-transform: translate($x, $y);
292
- -o-transform: translate($x, $y);
143
+ -ms-transform: translate($x, $y); // IE9+
293
144
  transform: translate($x, $y);
294
145
  }
295
146
  @mixin skew($x, $y) {
296
147
  -webkit-transform: skew($x, $y);
297
- -moz-transform: skew($x, $y);
298
- -ms-transform: skewX($x) skewY($y); // See https://github.com/twitter/bootstrap/issues/4885
299
- -o-transform: skew($x, $y);
148
+ -ms-transform: skewX($x) skewY($y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+
300
149
  transform: skew($x, $y);
301
- -webkit-backface-visibility: hidden; // See https://github.com/twitter/bootstrap/issues/5319
302
150
  }
303
151
  @mixin translate3d($x, $y, $z) {
304
152
  -webkit-transform: translate3d($x, $y, $z);
305
- -moz-transform: translate3d($x, $y, $z);
306
- -o-transform: translate3d($x, $y, $z);
307
153
  transform: translate3d($x, $y, $z);
308
154
  }
309
155
 
310
156
  // Backface visibility
311
157
  // Prevent browsers from flickering when using CSS 3D transforms.
312
- // Default value is `visible`, but can be changed to `hidden
158
+ // Default value is `visible`, but can be changed to `hidden`
313
159
  // See git pull https://github.com/dannykeane/bootstrap.git backface-visibility for examples
314
160
  @mixin backface-visibility($visibility){
315
161
  -webkit-backface-visibility: $visibility;
@@ -317,23 +163,6 @@
317
163
  backface-visibility: $visibility;
318
164
  }
319
165
 
320
- // Background clipping
321
- // Heads up: FF 3.6 and under need "padding" instead of "padding-box"
322
- @mixin background-clip($clip) {
323
- -webkit-background-clip: $clip;
324
- -moz-background-clip: $clip;
325
- background-clip: $clip;
326
- }
327
-
328
- // Background sizing
329
- @mixin background-size($size) {
330
- -webkit-background-size: $size;
331
- -moz-background-size: $size;
332
- -o-background-size: $size;
333
- background-size: $size;
334
- }
335
-
336
-
337
166
  // Box sizing
338
167
  @mixin box-sizing($boxmodel) {
339
168
  -webkit-box-sizing: $boxmodel;
@@ -346,7 +175,7 @@
346
175
  @mixin user-select($select) {
347
176
  -webkit-user-select: $select;
348
177
  -moz-user-select: $select;
349
- -ms-user-select: $select;
178
+ -ms-user-select: $select; // IE10+
350
179
  -o-user-select: $select;
351
180
  user-select: $select;
352
181
  }
@@ -358,13 +187,13 @@
358
187
  }
359
188
 
360
189
  // CSS3 Content Columns
361
- @mixin content-columns($columnCount, $columnGap: $gridGutterWidth) {
362
- -webkit-column-count: $columnCount;
363
- -moz-column-count: $columnCount;
364
- column-count: $columnCount;
365
- -webkit-column-gap: $columnGap;
366
- -moz-column-gap: $columnGap;
367
- column-gap: $columnGap;
190
+ @mixin content-columns($column-count, $column-gap: $grid-gutter-width) {
191
+ -webkit-column-count: $column-count;
192
+ -moz-column-count: $column-count;
193
+ column-count: $column-count;
194
+ -webkit-column-gap: $column-gap;
195
+ -moz-column-gap: $column-gap;
196
+ column-gap: $column-gap;
368
197
  }
369
198
 
370
199
  // Optional hyphenation
@@ -372,155 +201,328 @@
372
201
  word-wrap: break-word;
373
202
  -webkit-hyphens: $mode;
374
203
  -moz-hyphens: $mode;
375
- -ms-hyphens: $mode;
204
+ -ms-hyphens: $mode; // IE10+
376
205
  -o-hyphens: $mode;
377
206
  hyphens: $mode;
378
207
  }
379
208
 
380
209
  // Opacity
381
210
  @mixin opacity($opacity) {
382
- opacity: $opacity / 100;
383
- filter: alpha(opacity=$opacity);
211
+ opacity: $opacity;
212
+ // IE8 filter
213
+ $opacity-ie: ($opacity * 100);
214
+ filter: #{alpha(opacity=$opacity-ie)};
384
215
  }
385
216
 
386
217
 
387
218
 
388
- // BACKGROUNDS
219
+ // GRADIENTS
389
220
  // --------------------------------------------------
390
221
 
391
- // Add an alphatransparency value to any background or border color (via Elyse Holladay)
392
- @mixin translucent-background($color: $white, $alpha: 1) {
393
- background-color: hsla(hue($color), saturation($color), lightness($color), $alpha);
394
- }
395
222
 
396
- @mixin translucent-border($color: $white, $alpha: 1) {
397
- border-color: hsla(hue($color), saturation($color), lightness($color), $alpha);
398
- @include background-clip(padding-box);
399
- }
400
223
 
401
- // Gradient Bar Colors for buttons and alerts
402
- @mixin gradientBar($primaryColor, $secondaryColor, $textColor: #fff, $textShadow: 0 -1px 0 rgba(0,0,0,.25)) {
403
- color: $textColor;
404
- text-shadow: $textShadow;
405
- @include gradient-vertical($primaryColor, $secondaryColor);
406
- border-color: $secondaryColor $secondaryColor darken($secondaryColor, 15%);
407
- border-color: rgba(0,0,0,.1) rgba(0,0,0,.1) fade-in(rgba(0,0,0,.1), 0.15);
224
+ // Horizontal gradient, from left to right
225
+ //
226
+ // Creates two color stops, start and end, by specifying a color and position for each color stop.
227
+ // Color stops are not available in IE9 and below.
228
+ @mixin gradient-horizontal($start-color: #555, $end-color: #333, $start-percent: 0%, $end-percent: 100%) {
229
+ background-image: -webkit-gradient(linear, $start-percent top, $end-percent top, from($start-color), to($end-color)); // Safari 4+, Chrome 2+
230
+ background-image: -webkit-linear-gradient(left, color-stop($start-color $start-percent), color-stop($end-color $end-percent)); // Safari 5.1+, Chrome 10+
231
+ background-image: -moz-linear-gradient(left, $start-color $start-percent, $end-color $end-percent); // FF 3.6+
232
+ background-image: linear-gradient(to right, $start-color $start-percent, $end-color $end-percent); // Standard, IE10
233
+ background-repeat: repeat-x;
234
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=1); // IE9 and down
408
235
  }
409
236
 
410
- // Gradients
411
- @mixin gradient-horizontal($startColor: #555, $endColor: #333) {
412
- background-color: $endColor;
413
- background-image: -moz-linear-gradient(left, $startColor, $endColor); // FF 3.6+
414
- background-image: -webkit-gradient(linear, 0 0, 100% 0, from($startColor), to($endColor)); // Safari 4+, Chrome 2+
415
- background-image: -webkit-linear-gradient(left, $startColor, $endColor); // Safari 5.1+, Chrome 10+
416
- background-image: -o-linear-gradient(left, $startColor, $endColor); // Opera 11.10
417
- background-image: linear-gradient(to right, $startColor, $endColor); // Standard, IE10
418
- background-repeat: repeat-x;
419
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($startColor)}', endColorstr='#{ie-hex-str($endColor)}', GradientType=1); // IE9 and down
420
- }
421
- @mixin gradient-vertical($startColor: #555, $endColor: #333) {
422
- background-color: mix($startColor, $endColor, 60%);
423
- background-image: -moz-linear-gradient(top, $startColor, $endColor); // FF 3.6+
424
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from($startColor), to($endColor)); // Safari 4+, Chrome 2+
425
- background-image: -webkit-linear-gradient(top, $startColor, $endColor); // Safari 5.1+, Chrome 10+
426
- background-image: -o-linear-gradient(top, $startColor, $endColor); // Opera 11.10
427
- background-image: linear-gradient(to bottom, $startColor, $endColor); // Standard, IE10
237
+ // Vertical gradient, from top to bottom
238
+ //
239
+ // Creates two color stops, start and end, by specifying a color and position for each color stop.
240
+ // Color stops are not available in IE9 and below.
241
+ @mixin gradient-vertical($start-color: #555, $end-color: #333, $start-percent: 0%, $end-percent: 100%) {
242
+ background-image: -webkit-gradient(linear, left $start-percent, left $end-percent, from($start-color), to($end-color)); // Safari 4+, Chrome 2+
243
+ background-image: -webkit-linear-gradient(top, $start-color, $start-percent, $end-color, $end-percent); // Safari 5.1+, Chrome 10+
244
+ background-image: -moz-linear-gradient(top, $start-color $start-percent, $end-color $end-percent); // FF 3.6+
245
+ background-image: linear-gradient(to bottom, $start-color $start-percent, $end-color $end-percent); // Standard, IE10
428
246
  background-repeat: repeat-x;
429
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($startColor)}', endColorstr='#{ie-hex-str($endColor)}', GradientType=0); // IE9 and down
247
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=0); // IE9 and down
430
248
  }
431
- @mixin gradient-directional($startColor: #555, $endColor: #333, $deg: 45deg) {
432
- background-color: $endColor;
249
+
250
+ @mixin gradient-directional($start-color: #555, $end-color: #333, $deg: 45deg) {
433
251
  background-repeat: repeat-x;
434
- background-image: -moz-linear-gradient($deg, $startColor, $endColor); // FF 3.6+
435
- background-image: -webkit-linear-gradient($deg, $startColor, $endColor); // Safari 5.1+, Chrome 10+
436
- background-image: -o-linear-gradient($deg, $startColor, $endColor); // Opera 11.10
437
- background-image: linear-gradient($deg, $startColor, $endColor); // Standard, IE10
438
- }
439
- @mixin gradient-vertical-three-colors($startColor: #00b3ee, $midColor: #7a43b6, $colorStop: 50%, $endColor: #c3325f) {
440
- background-color: mix($midColor, $endColor, 80%);
441
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from($startColor), color-stop($colorStop, $midColor), to($endColor));
442
- background-image: -webkit-linear-gradient($startColor, $midColor $colorStop, $endColor);
443
- background-image: -moz-linear-gradient(top, $startColor, $midColor $colorStop, $endColor);
444
- background-image: -o-linear-gradient($startColor, $midColor $colorStop, $endColor);
445
- background-image: linear-gradient($startColor, $midColor $colorStop, $endColor);
252
+ background-image: -webkit-linear-gradient($deg, $start-color, $end-color); // Safari 5.1+, Chrome 10+
253
+ background-image: -moz-linear-gradient($deg, $start-color, $end-color); // FF 3.6+
254
+ background-image: linear-gradient($deg, $start-color, $end-color); // Standard, IE10
255
+ }
256
+ @mixin gradient-horizontal-three-colors($start-color: #00b3ee, $mid-color: #7a43b6, $color-stop: 50%, $end-color: #c3325f) {
257
+ background-image: -webkit-gradient(left, linear, 0 0, 0 100%, from($start-color), color-stop($color-stop, $mid-color), to($end-color));
258
+ background-image: -webkit-linear-gradient(left, $start-color, $mid-color $color-stop, $end-color);
259
+ background-image: -moz-linear-gradient(left, $start-color, $mid-color $color-stop, $end-color);
260
+ background-image: linear-gradient(to right, $start-color, $mid-color $color-stop, $end-color);
446
261
  background-repeat: no-repeat;
447
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($startColor)}', endColorstr='#{ie-hex-str($endColor)}', GradientType=0); // IE9 and down, gets no color-stop at all for proper fallback
448
- }
449
- @mixin gradient-radial($innerColor: #555, $outerColor: #333) {
450
- background-color: $outerColor;
451
- background-image: -webkit-gradient(radial, center center, 0, center center, 460, from($innerColor), to($outerColor));
452
- background-image: -webkit-radial-gradient(circle, $innerColor, $outerColor);
453
- background-image: -moz-radial-gradient(circle, $innerColor, $outerColor);
454
- background-image: -o-radial-gradient(circle, $innerColor, $outerColor);
262
+ 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
263
+ }
264
+ @mixin gradient-vertical-three-colors($start-color: #00b3ee, $mid-color: #7a43b6, $color-stop: 50%, $end-color: #c3325f) {
265
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from($start-color), color-stop($color-stop, $mid-color), to($end-color));
266
+ background-image: -webkit-linear-gradient($start-color, $mid-color $color-stop, $end-color);
267
+ background-image: -moz-linear-gradient(top, $start-color, $mid-color $color-stop, $end-color);
268
+ background-image: linear-gradient($start-color, $mid-color $color-stop, $end-color);
269
+ background-repeat: no-repeat;
270
+ 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
271
+ }
272
+ @mixin gradient-radial($inner-color: #555, $outer-color: #333) {
273
+ background-image: -webkit-gradient(radial, center center, 0, center center, 460, from($inner-color), to($outer-color));
274
+ background-image: -webkit-radial-gradient(circle, $inner-color, $outer-color);
275
+ background-image: -moz-radial-gradient(circle, $inner-color, $outer-color);
276
+ background-image: radial-gradient(circle, $inner-color, $outer-color);
455
277
  background-repeat: no-repeat;
456
278
  }
457
279
  @mixin gradient-striped($color: #555, $angle: 45deg) {
458
- background-color: $color;
459
280
  background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(.25, rgba(255,255,255,.15)), color-stop(.25, transparent), color-stop(.5, transparent), color-stop(.5, rgba(255,255,255,.15)), color-stop(.75, rgba(255,255,255,.15)), color-stop(.75, transparent), to(transparent));
460
281
  background-image: -webkit-linear-gradient($angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
461
282
  background-image: -moz-linear-gradient($angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
462
- background-image: -o-linear-gradient($angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
463
283
  background-image: linear-gradient($angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
464
284
  }
465
285
 
466
286
  // Reset filters for IE
287
+ //
288
+ // When you need to remove a gradient background, do not forget to use this to reset
289
+ // the IE filter for IE9 and below.
467
290
  @mixin reset-filter() {
468
- filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
291
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
469
292
  }
470
293
 
471
294
 
472
295
 
296
+ // Retina images
297
+ //
298
+ // Short retina mixin for setting background-image and -size
299
+
300
+ @mixin img-retina($file-1x, $file-2x, $width-1x, $height-1x) {
301
+ background-image: image-url("#{$file-1x}");
302
+
303
+ @media
304
+ only screen and (-webkit-min-device-pixel-ratio: 2),
305
+ only screen and ( min--moz-device-pixel-ratio: 2),
306
+ only screen and ( -o-min-device-pixel-ratio: 2/1),
307
+ only screen and ( min-device-pixel-ratio: 2),
308
+ only screen and ( min-resolution: 192dpi),
309
+ only screen and ( min-resolution: 2dppx) {
310
+ background-image: image-url("#{$file-2x}");
311
+ background-size: $width-1x $height-1x;
312
+ }
313
+ }
314
+
315
+
316
+ // Responsive image
317
+ //
318
+ // Keep images from scaling beyond the width of their parents.
319
+
320
+ @mixin img-responsive($display: block) {
321
+ display: $display;
322
+ max-width: 100%; // Part 1: Set a maximum relative to the parent
323
+ height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching
324
+ }
325
+
326
+
473
327
  // COMPONENT MIXINS
474
328
  // --------------------------------------------------
475
329
 
476
330
  // Horizontal dividers
477
331
  // -------------------------
478
332
  // Dividers (basically an hr) within dropdowns and nav lists
479
- @mixin nav-divider($top: #e5e5e5, $bottom: $white) {
480
- // IE7 needs a set width since we gave a height. Restricting just
481
- // to IE7 to keep the 1px left/right space in other browsers.
482
- // It is unclear where IE is getting the extra space that we need
483
- // to negative-margin away, but so it goes.
484
- *width: 100%;
333
+ @mixin nav-divider($color: #e5e5e5) {
485
334
  height: 1px;
486
- margin: (($baseLineHeight / 2) - 1) 1px; // 8px 1px
487
- *margin: -5px 0 5px;
335
+ margin: (($line-height-computed / 2) - 1) 0;
488
336
  overflow: hidden;
489
- background-color: $top;
490
- border-bottom: 1px solid $bottom;
337
+ background-color: $color;
491
338
  }
492
339
 
493
- // Button backgrounds
494
- // ------------------
495
- @mixin buttonBackground($startColor, $endColor, $textColor: #fff, $textShadow: 0 -1px 0 rgba(0,0,0,.25)) {
496
- // gradientBar will set the background to a pleasing blend of these, to support IE<=9
497
- @include gradientBar($startColor, $endColor, $textColor, $textShadow);
498
- *background-color: $endColor; /* Darken IE7 buttons by default so they stand out more given they won't have borders */
499
- @include reset-filter();
340
+ // Panels
341
+ // -------------------------
342
+ @mixin panel-variant($border, $heading-text-color, $heading-bg-color, $heading-border) {
343
+ border-color: $border;
344
+ & > .panel-heading {
345
+ color: $heading-text-color;
346
+ background-color: $heading-bg-color;
347
+ border-color: $heading-border;
348
+ + .panel-collapse .panel-body {
349
+ border-top-color: $border;
350
+ }
351
+ }
352
+ & > .panel-footer {
353
+ + .panel-collapse .panel-body {
354
+ border-bottom-color: $border;
355
+ }
356
+ }
357
+ }
500
358
 
501
- // in these cases the gradient won't cover the background, so we override
502
- &:hover, &:focus, &:active, &.active, &.disabled, &[disabled] {
503
- color: $textColor;
504
- background-color: $endColor;
505
- *background-color: darken($endColor, 5%);
359
+ // Alerts
360
+ // -------------------------
361
+ @mixin alert-variant($background, $border, $text-color) {
362
+ background-color: $background;
363
+ border-color: $border;
364
+ color: $text-color;
365
+ hr {
366
+ border-top-color: darken($border, 5%);
367
+ }
368
+ .alert-link {
369
+ color: darken($text-color, 10%);
370
+ }
371
+ }
372
+
373
+ // Tables
374
+ // -------------------------
375
+ @mixin table-row-variant($state, $background, $border) {
376
+ // Exact selectors below required to override `.table-striped` and prevent
377
+ // inheritance to nested tables.
378
+ .table > thead > tr,
379
+ .table > tbody > tr,
380
+ .table > tfoot > tr {
381
+ > td.#{$state},
382
+ > th.#{$state},
383
+ &.#{$state} > td,
384
+ &.#{$state} > th {
385
+ background-color: $background;
386
+ border-color: $border;
387
+ }
506
388
  }
507
389
 
508
- // IE 7 + 8 can't handle box-shadow to show active, so we darken a bit ourselves
390
+ // Hover states for `.table-hover`
391
+ // Note: this is not available for cells or rows within `thead` or `tfoot`.
392
+ .table-hover > tbody > tr {
393
+ > td.#{$state}:hover,
394
+ > th.#{$state}:hover,
395
+ &.#{$state}:hover > td {
396
+ background-color: darken($background, 5%);
397
+ border-color: darken($border, 5%);
398
+ }
399
+ }
400
+ }
401
+
402
+ // Button variants
403
+ // -------------------------
404
+ // Easily pump out default styles, as well as :hover, :focus, :active,
405
+ // and disabled options for all buttons
406
+ @mixin button-variant($color, $background, $border) {
407
+ color: $color;
408
+ background-color: $background;
409
+ border-color: $border;
410
+
411
+ &:hover,
412
+ &:focus,
509
413
  &:active,
510
414
  &.active {
511
- background-color: darken($endColor, 10%) \9;
415
+ color: $color;
416
+ background-color: darken($background, 8%);
417
+ border-color: darken($border, 12%);
418
+ }
419
+ .open & { &.dropdown-toggle {
420
+ color: $color;
421
+ background-color: darken($background, 8%);
422
+ border-color: darken($border, 12%);
423
+ } }
424
+ &:active,
425
+ &.active {
426
+ background-image: none;
427
+ }
428
+ .open & { &.dropdown-toggle {
429
+ background-image: none;
430
+ } }
431
+ &.disabled,
432
+ &[disabled],
433
+ fieldset[disabled] & {
434
+ &,
435
+ &:hover,
436
+ &:focus,
437
+ &:active,
438
+ &.active {
439
+ background-color: $background;
440
+ border-color: $border
441
+ }
442
+ }
443
+ }
444
+
445
+ // Button sizes
446
+ // -------------------------
447
+ @mixin button-size($padding-vertical, $padding-horizontal, $font-size, $line-height, $border-radius) {
448
+ padding: $padding-vertical $padding-horizontal;
449
+ font-size: $font-size;
450
+ line-height: $line-height;
451
+ border-radius: $border-radius;
452
+ }
453
+
454
+ // Pagination
455
+ // -------------------------
456
+ @mixin pagination-size($padding-vertical, $padding-horizontal, $font-size, $border-radius) {
457
+ > li {
458
+ > a,
459
+ > span {
460
+ padding: $padding-vertical $padding-horizontal;
461
+ font-size: $font-size;
462
+ }
463
+ &:first-child {
464
+ > a,
465
+ > span {
466
+ @include border-left-radius($border-radius);
467
+ }
468
+ }
469
+ &:last-child {
470
+ > a,
471
+ > span {
472
+ @include border-right-radius($border-radius);
473
+ }
474
+ }
475
+ }
476
+ }
477
+
478
+ // Labels
479
+ // -------------------------
480
+ @mixin label-variant($color) {
481
+ background-color: $color;
482
+ &[href] {
483
+ &:hover,
484
+ &:focus {
485
+ background-color: darken($color, 10%);
486
+ }
512
487
  }
513
488
  }
514
489
 
515
490
  // Navbar vertical align
516
491
  // -------------------------
517
492
  // Vertically center elements in the navbar.
518
- // Example: an element has a height of 30px, so write out `.navbarVerticalAlign(30px);` to calculate the appropriate top margin.
519
- @mixin navbarVerticalAlign($elementHeight) {
520
- margin-top: ($navbarHeight - $elementHeight) / 2;
493
+ // Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin.
494
+ @mixin navbar-vertical-align($element-height) {
495
+ margin-top: (($navbar-height - $element-height) / 2);
496
+ margin-bottom: (($navbar-height - $element-height) / 2);
521
497
  }
522
498
 
499
+ // Progress bars
500
+ // -------------------------
501
+ @mixin progress-bar-variant($color) {
502
+ background-color: $color;
503
+ .progress-striped & {
504
+ @include gradient-striped($color);
505
+ }
506
+ }
523
507
 
508
+ // Responsive utilities
509
+ // -------------------------
510
+ // More easily include all the states for responsive-utilities.less.
511
+ // [converter] $parent hack
512
+ @mixin responsive-visibility($parent) {
513
+ #{$parent} { display: block !important; }
514
+ tr#{$parent} { display: table-row !important; }
515
+ th#{$parent},
516
+ td#{$parent} { display: table-cell !important; }
517
+ }
518
+
519
+ // [converter] $parent hack
520
+ @mixin responsive-invisibility($parent) {
521
+ #{$parent} { display: none !important; }
522
+ tr#{$parent} { display: none !important; }
523
+ th#{$parent},
524
+ td#{$parent} { display: none !important; }
525
+ }
524
526
 
525
527
  // Grid System
526
528
  // -----------
@@ -529,162 +531,200 @@
529
531
  @mixin container-fixed() {
530
532
  margin-right: auto;
531
533
  margin-left: auto;
534
+ padding-left: ($grid-gutter-width / 2);
535
+ padding-right: ($grid-gutter-width / 2);
532
536
  @include clearfix();
533
537
  }
534
538
 
535
- // Table columns
536
- @mixin tableColumns($columnSpan: 1) {
537
- float: none; // undo default grid column styles
538
- width: (($gridColumnWidth) * $columnSpan) + ($gridGutterWidth * ($columnSpan - 1)) - 16; // 16 is total padding on left and right of table cells
539
- margin-left: 0; // undo default grid column styles
540
- }
541
-
542
- // Make a Grid
543
- // Use .makeRow and .makeColumn to assign semantic layouts grid system behavior
544
- @mixin makeRow() {
545
- margin-left: $gridGutterWidth * -1;
539
+ // Creates a wrapper for a series of columns
540
+ @mixin make-row($gutter: $grid-gutter-width) {
541
+ margin-left: ($gutter / -2);
542
+ margin-right: ($gutter / -2);
546
543
  @include clearfix();
547
544
  }
548
- @mixin makeColumn($columns: 1, $offset: 0) {
549
- float: left;
550
- margin-left: ($gridColumnWidth * $offset) + ($gridGutterWidth * ($offset - 1)) + ($gridGutterWidth * 2);
551
- width: ($gridColumnWidth * $columns) + ($gridGutterWidth * ($columns - 1));
552
- }
553
-
554
- // The Grid
555
- @mixin grid-core($gridColumnWidth, $gridGutterWidth) {
556
- .row {
557
- margin-left: $gridGutterWidth * -1;
558
- @include clearfix();
559
- }
560
545
 
561
- [class*="span"] {
546
+ // Generate the extra small columns
547
+ @mixin make-xs-column($columns, $gutter: $grid-gutter-width) {
548
+ position: relative;
549
+ float: left;
550
+ width: percentage(($columns / $grid-columns));
551
+ // Prevent columns from collapsing when empty
552
+ min-height: 1px;
553
+ // Inner gutter via padding
554
+ padding-left: ($gutter / 2);
555
+ padding-right: ($gutter / 2);
556
+ }
557
+
558
+ // Generate the small columns
559
+ @mixin make-sm-column($columns, $gutter: $grid-gutter-width) {
560
+ position: relative;
561
+ // Prevent columns from collapsing when empty
562
+ min-height: 1px;
563
+ // Inner gutter via padding
564
+ padding-left: ($gutter / 2);
565
+ padding-right: ($gutter / 2);
566
+
567
+ // Calculate width based on number of columns available
568
+ @media (min-width: $screen-sm) {
562
569
  float: left;
563
- min-height: 1px; // prevent collapsing columns
564
- margin-left: $gridGutterWidth;
570
+ width: percentage(($columns / $grid-columns));
565
571
  }
572
+ }
566
573
 
567
- // Set the container width, and override it for fixed navbars in media queries
568
- .container,
569
- .navbar-static-top .container,
570
- .navbar-fixed-top .container,
571
- .navbar-fixed-bottom .container {
572
- @include grid-core-span($gridColumns, $gridColumnWidth, $gridGutterWidth);
574
+ // Generate the small column offsets
575
+ @mixin make-sm-column-offset($columns) {
576
+ @media (min-width: $screen-sm) {
577
+ margin-left: percentage(($columns / $grid-columns));
573
578
  }
574
-
575
- // generate .spanX and .offsetX
576
- @include grid-core-span-x($gridColumns, $gridColumnWidth, $gridGutterWidth);
577
- @include grid-core-offset-x($gridColumns, $gridColumnWidth, $gridGutterWidth);
578
579
  }
579
-
580
- @mixin grid-core-span-x($gridColumns, $gridColumnWidth, $gridGutterWidth) {
581
- @while $gridColumns > 0 {
582
- .span#{$gridColumns} { @include grid-core-span($gridColumns, $gridColumnWidth, $gridGutterWidth)}
583
- $gridColumns: $gridColumns - 1;
580
+ @mixin make-sm-column-push($columns) {
581
+ @media (min-width: $screen-sm) {
582
+ left: percentage(($columns / $grid-columns));
584
583
  }
585
584
  }
586
-
587
- @mixin grid-core-offset-x($gridColumns, $gridColumnWidth, $gridGutterWidth) {
588
- @while $gridColumns > 0 {
589
- .offset#{$gridColumns} { @include grid-core-offset($gridColumns, $gridColumnWidth, $gridGutterWidth); }
590
- $gridColumns: $gridColumns - 1;
585
+ @mixin make-sm-column-pull($columns) {
586
+ @media (min-width: $screen-sm) {
587
+ right: percentage(($columns / $grid-columns));
591
588
  }
592
589
  }
593
590
 
594
- @mixin grid-core-span($columns, $gridColumnWidth, $gridGutterWidth) {
595
- width: ($gridColumnWidth * $columns) + ($gridGutterWidth * ($columns - 1));
596
- }
591
+ // Generate the medium columns
592
+ @mixin make-md-column($columns, $gutter: $grid-gutter-width) {
593
+ position: relative;
594
+ // Prevent columns from collapsing when empty
595
+ min-height: 1px;
596
+ // Inner gutter via padding
597
+ padding-left: ($gutter / 2);
598
+ padding-right: ($gutter / 2);
597
599
 
598
- @mixin grid-core-offset($columns, $gridColumnWidth, $gridGutterWidth) {
599
- margin-left: ($gridColumnWidth * $columns) + ($gridGutterWidth * ($columns + 1));
600
+ // Calculate width based on number of columns available
601
+ @media (min-width: $screen-md) {
602
+ float: left;
603
+ width: percentage(($columns / $grid-columns));
604
+ }
600
605
  }
601
606
 
602
-
603
-
604
- @mixin grid-fluid($fluidGridColumnWidth, $fluidGridGutterWidth) {
605
- .row-fluid {
606
- width: 100%;
607
- @include clearfix();
608
- [class*="span"] {
609
- @include input-block-level();
610
- float: left;
611
- margin-left: $fluidGridGutterWidth;
612
- *margin-left: $fluidGridGutterWidth - (.5 / $gridRowWidth * 100px * 1%);
613
- }
614
- [class*="span"]:first-child {
615
- margin-left: 0;
616
- }
617
-
618
- // Space grid-sized controls properly if multiple per line
619
- .controls-row [class*="span"] + [class*="span"] {
620
- margin-left: $fluidGridGutterWidth;
621
- }
622
-
623
- // generate .spanX and .offsetX
624
- @include grid-fluid-span-x($gridColumns, $fluidGridColumnWidth, $fluidGridGutterWidth);
625
- @include grid-fluid-offset-x($gridColumns, $fluidGridColumnWidth, $fluidGridGutterWidth);
607
+ // Generate the large column offsets
608
+ @mixin make-md-column-offset($columns) {
609
+ @media (min-width: $screen-md) {
610
+ margin-left: percentage(($columns / $grid-columns));
626
611
  }
627
612
  }
628
-
629
- @mixin grid-fluid-span-x($gridColumns, $fluidGridColumnWidth, $fluidGridGutterWidth) {
630
- @while $gridColumns > 0 {
631
- .span#{$gridColumns} { @include grid-fluid-span($gridColumns, $fluidGridColumnWidth, $fluidGridGutterWidth); }
632
- $gridColumns: $gridColumns - 1;
613
+ @mixin make-md-column-push($columns) {
614
+ @media (min-width: $screen-md) {
615
+ left: percentage(($columns / $grid-columns));
633
616
  }
634
617
  }
635
-
636
- @mixin grid-fluid-offset-x($gridColumns, $fluidGridColumnWidth, $fluidGridGutterWidth) {
637
- @while $gridColumns > 0 {
638
- .offset#{$gridColumns} { @include grid-fluid-offset($gridColumns, $fluidGridColumnWidth, $fluidGridGutterWidth); }
639
- .offset#{$gridColumns}:first-child { @include grid-fluid-offset-first-child($gridColumns, $fluidGridColumnWidth, $fluidGridGutterWidth); }
640
- $gridColumns: $gridColumns - 1;
618
+ @mixin make-md-column-pull($columns) {
619
+ @media (min-width: $screen-md) {
620
+ right: percentage(($columns / $grid-columns));
641
621
  }
642
622
  }
643
623
 
644
- @mixin grid-fluid-span($columns, $fluidGridColumnWidth, $fluidGridGutterWidth) {
645
- width: ($fluidGridColumnWidth * $columns) + ($fluidGridGutterWidth * ($columns - 1));
646
- *width: ($fluidGridColumnWidth * $columns) + ($fluidGridGutterWidth * ($columns - 1)) - (.5 / $gridRowWidth * 100px * 1%);
647
- }
624
+ // Generate the large columns
625
+ @mixin make-lg-column($columns, $gutter: $grid-gutter-width) {
626
+ position: relative;
627
+ // Prevent columns from collapsing when empty
628
+ min-height: 1px;
629
+ // Inner gutter via padding
630
+ padding-left: ($gutter / 2);
631
+ padding-right: ($gutter / 2);
648
632
 
649
- @mixin grid-fluid-offset($columns, $fluidGridColumnWidth, $fluidGridGutterWidth) {
650
- margin-left: ($fluidGridColumnWidth * $columns) + ($fluidGridGutterWidth * ($columns - 1)) + ($fluidGridGutterWidth * 2);
651
- *margin-left: ($fluidGridColumnWidth * $columns) + ($fluidGridGutterWidth * ($columns - 1)) - (.5 / $gridRowWidth * 100px * 1%) + ($fluidGridGutterWidth * 2) - (.5 / $gridRowWidth * 100px * 1%);
633
+ // Calculate width based on number of columns available
634
+ @media (min-width: $screen-lg) {
635
+ float: left;
636
+ width: percentage(($columns / $grid-columns));
637
+ }
652
638
  }
653
639
 
654
- @mixin grid-fluid-offset-first-child($columns, $fluidGridColumnWidth, $fluidGridGutterWidth) {
655
- margin-left: ($fluidGridColumnWidth * $columns) + ($fluidGridGutterWidth * ($columns - 1)) + ($fluidGridGutterWidth);
656
- *margin-left: ($fluidGridColumnWidth * $columns) + ($fluidGridGutterWidth * ($columns - 1)) - (.5 / $gridRowWidth * 100px * 1%) + $fluidGridGutterWidth - (.5 / $gridRowWidth * 100px * 1%);
640
+ // Generate the large column offsets
641
+ @mixin make-lg-column-offset($columns) {
642
+ @media (min-width: $screen-lg) {
643
+ margin-left: percentage(($columns / $grid-columns));
644
+ }
645
+ }
646
+ @mixin make-lg-column-push($columns) {
647
+ @media (min-width: $screen-lg) {
648
+ left: percentage(($columns / $grid-columns));
649
+ }
650
+ }
651
+ @mixin make-lg-column-pull($columns) {
652
+ @media (min-width: $screen-lg) {
653
+ right: percentage(($columns / $grid-columns));
654
+ }
657
655
  }
658
656
 
659
657
 
658
+ // Form validation states
659
+ //
660
+ // Used in forms.less to generate the form validation CSS for warnings, errors,
661
+ // and successes.
660
662
 
661
- @mixin grid-input($gridColumnWidth, $gridGutterWidth) {
662
- input,
663
- textarea,
664
- .uneditable-input {
665
- margin-left: 0; // override margin-left from core grid system
663
+ @mixin form-control-validation($text-color: #555, $border-color: #ccc, $background-color: #f5f5f5) {
664
+ // Color the label and help text
665
+ .help-block,
666
+ .control-label {
667
+ color: $text-color;
666
668
  }
667
-
668
- // Space grid-sized controls properly if multiple per line
669
- .controls-row [class*="span"] + [class*="span"] {
670
- margin-left: $gridGutterWidth;
669
+ // Set the border and box shadow on specific inputs to match
670
+ .form-control {
671
+ border-color: $border-color;
672
+ @include box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work
673
+ &:focus {
674
+ border-color: darken($border-color, 10%);
675
+ $shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten($border-color, 20%);
676
+ @include box-shadow($shadow);
677
+ }
678
+ }
679
+ // Set validation states also for addons
680
+ .input-group-addon {
681
+ color: $text-color;
682
+ border-color: $border-color;
683
+ background-color: $background-color;
671
684
  }
672
-
673
- // generate .spanX
674
- @include grid-input-span-x($gridColumns, $gridColumnWidth, $gridGutterWidth);
675
685
  }
676
686
 
677
- @mixin grid-input-span-x($gridColumns, $gridColumnWidth, $gridGutterWidth) {
678
- @while $gridColumns > 0 {
679
- input.span#{$gridColumns},
680
- textarea.span#{$gridColumns},
681
- .uneditable-input.span#{$gridColumns} {
682
- @include grid-input-span($gridColumns, $gridColumnWidth, $gridGutterWidth);
683
- }
684
- $gridColumns: $gridColumns - 1;
687
+ // Form control focus state
688
+ //
689
+ // Generate a customized focus state and for any input with the specified color,
690
+ // which defaults to the `$input-focus-border` variable.
691
+ //
692
+ // We highly encourage you to not customize the default value, but instead use
693
+ // this to tweak colors on an as-needed basis. This aesthetic change is based on
694
+ // WebKit's default styles, but applicable to a wider range of browsers. Its
695
+ // usability and accessibility should be taken into account with any change.
696
+ //
697
+ // Example usage: change the default blue border and shadow to white for better
698
+ // contrast against a dark gray background.
699
+
700
+ @mixin form-control-focus($color: $input-border-focus) {
701
+ $color-rgba: rgba(red($color), green($color), blue($color), .6);
702
+ &:focus {
703
+ border-color: $color;
704
+ outline: 0;
705
+ @include box-shadow(inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px $color-rgba);
685
706
  }
686
707
  }
687
708
 
688
- @mixin grid-input-span($columns, $gridColumnWidth, $gridGutterWidth) {
689
- width: (($gridColumnWidth) * $columns) + ($gridGutterWidth * ($columns - 1)) - 14;
709
+ // Form control sizing
710
+ //
711
+ // Relative text size, padding, and border-radii changes for form controls. For
712
+ // horizontal sizing, wrap controls in the predefined grid classes. `<select>`
713
+ // element gets special love because it's special, and that's a fact!
714
+
715
+ // [converter] $parent hack
716
+ @mixin input-size($parent, $input-height, $padding-vertical, $padding-horizontal, $font-size, $line-height, $border-radius) {
717
+ #{$parent} { height: $input-height;
718
+ padding: $padding-vertical $padding-horizontal;
719
+ font-size: $font-size;
720
+ line-height: $line-height;
721
+ border-radius: $border-radius; }
722
+ select#{$parent} {
723
+ height: $input-height;
724
+ line-height: $input-height;
725
+ }
726
+
727
+ textarea#{$parent} {
728
+ height: auto;
729
+ }
690
730
  }