mixins.less 17.7 KB
Newer Older
1
2
3
//
// Mixins
// --------------------------------------------------
4

5

6
7
8
9
// UTILITY MIXINS
// --------------------------------------------------

// Clearfix
Mark Otto's avatar
Mark Otto committed
10
// --------
11
// For clearing floats like a boss h5bp.com/q
12
.clearfix() {
13
  &:before,
14
  &:after {
15
16
    display: table;
    content: "";
17
18
19
    // Fixes Opera/contenteditable bug:
    // http://nicolasgallagher.com/micro-clearfix-hack/#comment-36952
    line-height: 0;
20
21
  }
  &:after {
22
    clear: both;
23
  }
24
25
}

Mark Otto's avatar
Mark Otto committed
26
27
28
29
// Webkit-style focus
// ------------------
.tab-focus() {
  // Default
30
  outline: thin dotted #333;
Mark Otto's avatar
Mark Otto committed
31
32
33
34
35
  // Webkit
  outline: 5px auto -webkit-focus-ring-color;
  outline-offset: -2px;
}

36
// Center-align a block level element
Mark Otto's avatar
Mark Otto committed
37
// ----------------------------------
38
.center-block() {
39
  display: block;
40
41
  margin-left: auto;
  margin-right: auto;
42
43
44
}

// Sizing shortcuts
45
// -------------------------
46
.size(@width, @height) {
47
  width: @width;
48
  height: @height;
49
}
50
.square(@size) {
51
  .size(@size, @size);
52
53
}

54
55
// Placeholder text
// -------------------------
56
.placeholder(@color: @placeholderText) {
57
  &:-moz-placeholder {
58
59
    color: @color;
  }
60
  &:-ms-input-placeholder {
61
62
    color: @color;
  }
63
  &::-webkit-input-placeholder {
64
65
66
67
    color: @color;
  }
}

Mark Otto's avatar
Mark Otto committed
68
69
70
71
72
73
74
75
76
// Text overflow
// -------------------------
// Requires inline-block or block for proper styling
.text-overflow() {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

77
// CSS image replacement
78
// -------------------------
79
// Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757
80
.hide-text() {
81
82
  font: 0/0 a;
  color: transparent;
83
  text-shadow: none;
84
  background-color: transparent;
85
  border: 0;
86
}
87

88

89
90
91
// FONTS
// --------------------------------------------------

92
#font {
93
94
  #family {
    .serif() {
Mark Otto's avatar
Mark Otto committed
95
      font-family: @font-family-serif;
96
97
    }
    .sans-serif() {
Mark Otto's avatar
Mark Otto committed
98
      font-family: @font-family-sans-serif;
99
100
    }
    .monospace() {
Mark Otto's avatar
Mark Otto committed
101
      font-family: @font-family-monospace;
102
    }
103
  }
104
  .shorthand(@size: @font-size-base, @weight: normal, @lineHeight: @line-height-base) {
105
106
107
108
    font-size: @size;
    font-weight: @weight;
    line-height: @lineHeight;
  }
109
  .serif(@size: @font-size-base, @weight: normal, @lineHeight: @line-height-base) {
110
111
    #font > #family > .serif;
    #font > .shorthand(@size, @weight, @lineHeight);
112
  }
113
  .sans-serif(@size: @font-size-base, @weight: normal, @lineHeight: @line-height-base) {
114
115
116
    #font > #family > .sans-serif;
    #font > .shorthand(@size, @weight, @lineHeight);
  }
117
  .monospace(@size: @font-size-base, @weight: normal, @lineHeight: @line-height-base) {
118
119
    #font > #family > .monospace;
    #font > .shorthand(@size, @weight, @lineHeight);
120
121
122
  }
}

123

124
// FORMS
125
126
// --------------------------------------------------

127
// Block level inputs
128
.input-block-level() {
129
130
131
132
133
  display: block;
  width: 100%;
}


134

135
// Mixin for form field states
Mark Otto's avatar
Mark Otto committed
136
.formFieldState(@text-color: #555, @borderColor: #ccc, @backgroundColor: #f5f5f5) {
137
  // Set the text color
138
  .control-label,
139
140
  .help-block,
  .help-inline {
Mark Otto's avatar
Mark Otto committed
141
    color: @text-color;
142
143
  }
  // Style inputs accordingly
Mark Otto's avatar
Mark Otto committed
144
145
  .checkbox,
  .radio,
146
  input,
147
148
  select,
  textarea {
Mark Otto's avatar
Mark Otto committed
149
    color: @text-color;
150
151
152
153
  }
  input,
  select,
  textarea {
154
    border-color: @borderColor;
155
    .box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work
156
157
    &:focus {
      border-color: darken(@borderColor, 10%);
158
159
      @shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@borderColor, 20%);
      .box-shadow(@shadow);
160
161
162
163
164
    }
  }
  // Give a small background color for input-prepend/-append
  .input-prepend .add-on,
  .input-append .add-on {
Mark Otto's avatar
Mark Otto committed
165
    color: @text-color;
166
    background-color: @backgroundColor;
Mark Otto's avatar
Mark Otto committed
167
    border-color: @text-color;
168
169
170
171
172
  }
}



173
174
175
// CSS3 PROPERTIES
// --------------------------------------------------

176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
// Single Corner Border Radius
.border-top-left-radius(@radius) {
  -webkit-border-top-left-radius: @radius;
      -moz-border-radius-topleft: @radius;
          border-top-left-radius: @radius;
}
.border-top-right-radius(@radius) {
  -webkit-border-top-right-radius: @radius;
      -moz-border-radius-topright: @radius;
          border-top-right-radius: @radius;
}
.border-bottom-right-radius(@radius) {
  -webkit-border-bottom-right-radius: @radius;
      -moz-border-radius-bottomright: @radius;
          border-bottom-right-radius: @radius;
}
Mark Otto's avatar
Mark Otto committed
192
193
194
195
196
.border-bottom-left-radius(@radius) {
  -webkit-border-bottom-left-radius: @radius;
      -moz-border-radius-bottomleft: @radius;
          border-bottom-left-radius: @radius;
}
197
198
199
200
201
202
203
204

// Single Side Border Radius
.border-top-radius(@radius) {
  .border-top-right-radius(@radius);
  .border-top-left-radius(@radius);
}
.border-right-radius(@radius) {
  .border-top-right-radius(@radius);
Mark Otto's avatar
Mark Otto committed
205
206
207
208
209
210
211
212
213
  .border-bottom-right-radius(@radius);
}
.border-bottom-radius(@radius) {
  .border-bottom-right-radius(@radius);
  .border-bottom-left-radius(@radius);
}
.border-left-radius(@radius) {
  .border-top-left-radius(@radius);
  .border-bottom-left-radius(@radius);
214
215
}

216
// Drop shadows
Mark Otto's avatar
Mark Otto committed
217
.box-shadow(@shadow) {
218
  -webkit-box-shadow: @shadow; // iOS <4.3 & Android <4.1
219
          box-shadow: @shadow;
220
221
222
}

// Transitions
Mark Otto's avatar
Mark Otto committed
223
224
225
226
227
.transition(@transition) {
  -webkit-transition: @transition;
     -moz-transition: @transition;
       -o-transition: @transition;
          transition: @transition;
228
}
Tunghsiao Liu's avatar
Tunghsiao Liu committed
229
230
231
232
233
234
.transition-delay(@transition-delay) {
  -webkit-transition-delay: @transition-delay;
     -moz-transition-delay: @transition-delay;
       -o-transition-delay: @transition-delay;
          transition-delay: @transition-delay;
}
235

Mark Otto's avatar
Mark Otto committed
236
// Transformations
237
.rotate(@degrees) {
238
239
  -webkit-transform: rotate(@degrees);
     -moz-transform: rotate(@degrees);
Mark Otto's avatar
Mark Otto committed
240
241
      -ms-transform: rotate(@degrees);
       -o-transform: rotate(@degrees);
242
243
          transform: rotate(@degrees);
}
244
245
246
247
248
249
.scale(@ratio) {
  -webkit-transform: scale(@ratio);
     -moz-transform: scale(@ratio);
      -ms-transform: scale(@ratio);
       -o-transform: scale(@ratio);
          transform: scale(@ratio);
250
}
251
.translate(@x, @y) {
Mark Otto's avatar
Mark Otto committed
252
253
254
255
256
257
  -webkit-transform: translate(@x, @y);
     -moz-transform: translate(@x, @y);
      -ms-transform: translate(@x, @y);
       -o-transform: translate(@x, @y);
          transform: translate(@x, @y);
}
258
.skew(@x, @y) {
Mark Otto's avatar
Mark Otto committed
259
260
  -webkit-transform: skew(@x, @y);
     -moz-transform: skew(@x, @y);
261
      -ms-transform: skewX(@x) skewY(@y); // See https://github.com/twitter/bootstrap/issues/4885
Mark Otto's avatar
Mark Otto committed
262
263
       -o-transform: skew(@x, @y);
          transform: skew(@x, @y);
264
  -webkit-backface-visibility: hidden; // See https://github.com/twitter/bootstrap/issues/5319
Mark Otto's avatar
Mark Otto committed
265
}
266
.translate3d(@x, @y, @z) {
267
268
269
270
  -webkit-transform: translate3d(@x, @y, @z);
     -moz-transform: translate3d(@x, @y, @z);
       -o-transform: translate3d(@x, @y, @z);
          transform: translate3d(@x, @y, @z);
271
}
272

273
274
275
276
// Backface visibility
// Prevent browsers from flickering when using CSS 3D transforms.
// Default value is `visible`, but can be changed to `hidden
// See git pull https://github.com/dannykeane/bootstrap.git backface-visibility for examples
277
.backface-visibility(@visibility){
278
	-webkit-backface-visibility: @visibility;
279
280
	   -moz-backface-visibility: @visibility;
	        backface-visibility: @visibility;
281
282
}

283
// Background clipping
Mark Otto's avatar
Mark Otto committed
284
285
286
287
.background-clip(@clip) {
  -webkit-background-clip: @clip;
     -moz-background-clip: @clip;
          background-clip: @clip;
288
289
}

290
// Background sizing
291
.background-size(@size) {
Mark Otto's avatar
Mark Otto committed
292
293
294
295
  -webkit-background-size: @size;
     -moz-background-size: @size;
       -o-background-size: @size;
          background-size: @size;
296
297
}

298
299
300
301
302
303
304
// Box sizing
.box-sizing(@boxmodel) {
  -webkit-box-sizing: @boxmodel;
     -moz-box-sizing: @boxmodel;
          box-sizing: @boxmodel;
}

305
306
307
308
309
// User select
// For selecting text on the page
.user-select(@select) {
  -webkit-user-select: @select;
     -moz-user-select: @select;
Han Lin Yap's avatar
Han Lin Yap committed
310
      -ms-user-select: @select;
311
312
313
314
       -o-user-select: @select;
          user-select: @select;
}

315
// Resize anything
316
.resizable(@direction) {
317
318
319
320
  resize: @direction; // Options: horizontal, vertical, both
  overflow: auto; // Safari fix
}

321
// CSS3 Content Columns
322
.content-columns(@columnCount, @columnGap: @gridGutterWidth) {
323
324
  -webkit-column-count: @columnCount;
     -moz-column-count: @columnCount;
325
326
          column-count: @columnCount;
  -webkit-column-gap: @columnGap;
327
     -moz-column-gap: @columnGap;
328
          column-gap: @columnGap;
329
330
}

Synchro's avatar
Synchro committed
331
332
// Optional hyphenation
.hyphens(@mode: auto) {
Mark Otto's avatar
Mark Otto committed
333
  word-wrap: break-word;
Synchro's avatar
Synchro committed
334
335
336
  -webkit-hyphens: @mode;
     -moz-hyphens: @mode;
      -ms-hyphens: @mode;
Synchro's avatar
Synchro committed
337
       -o-hyphens: @mode;
Synchro's avatar
Synchro committed
338
339
340
          hyphens: @mode;
}

341
// Opacity
342
.opacity(@opacity) {
343
  opacity: @opacity / 100;
344
  filter: ~"alpha(opacity=@{opacity})"; // IE8
345
346
347
348
349
350
351
}



// BACKGROUNDS
// --------------------------------------------------

352
353
// Gradients
#gradient {
354
  .horizontal(@startColor: #555, @endColor: #333) {
355
356
    background-color: @endColor;
    background-image: -moz-linear-gradient(left, @startColor, @endColor); // FF 3.6+
357
    background-image: -webkit-gradient(linear, 0 0, 100% 0, from(@startColor), to(@endColor)); // Safari 4+, Chrome 2+
358
359
    background-image: -webkit-linear-gradient(left, @startColor, @endColor); // Safari 5.1+, Chrome 10+
    background-image: -o-linear-gradient(left, @startColor, @endColor); // Opera 11.10
360
    background-image: linear-gradient(to right, @startColor, @endColor); // Standard, IE10
361
    background-repeat: repeat-x;
362
    filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",argb(@startColor),argb(@endColor))); // IE9 and down
363
  }
364
  .vertical(@startColor: #555, @endColor: #333) {
365
    background-color: mix(@startColor, @endColor, 60%);
Mark Otto's avatar
Mark Otto committed
366
    background-image: -moz-linear-gradient(top, @startColor, @endColor); // FF 3.6+
367
    background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), to(@endColor)); // Safari 4+, Chrome 2+
Mark Otto's avatar
Mark Otto committed
368
369
    background-image: -webkit-linear-gradient(top, @startColor, @endColor); // Safari 5.1+, Chrome 10+
    background-image: -o-linear-gradient(top, @startColor, @endColor); // Opera 11.10
370
    background-image: linear-gradient(top, @startColor, @endColor); // Standard, IE10
371
    background-repeat: repeat-x;
372
    filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@startColor),argb(@endColor))); // IE9 and down
373
  }
374
  .directional(@startColor: #555, @endColor: #333, @deg: 45deg) {
375
376
    background-color: @endColor;
    background-repeat: repeat-x;
377
378
379
    background-image: -moz-linear-gradient(@deg, @startColor, @endColor); // FF 3.6+
    background-image: -webkit-linear-gradient(@deg, @startColor, @endColor); // Safari 5.1+, Chrome 10+
    background-image: -o-linear-gradient(@deg, @startColor, @endColor); // Opera 11.10
380
    background-image: linear-gradient(@deg, @startColor, @endColor); // Standard, IE10
381
  }
sankage's avatar
sankage committed
382
  .vertical-three-colors(@startColor: #00b3ee, @midColor: #7a43b6, @colorStop: 50%, @endColor: #c3325f) {
383
    background-color: mix(@midColor, @endColor, 80%);
384
    background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), color-stop(@colorStop, @midColor), to(@endColor));
sankage's avatar
sankage committed
385
    background-image: -webkit-linear-gradient(@startColor, @midColor @colorStop, @endColor);
386
    background-image: -moz-linear-gradient(top, @startColor, @midColor @colorStop, @endColor);
sankage's avatar
sankage committed
387
388
    background-image: -o-linear-gradient(@startColor, @midColor @colorStop, @endColor);
    background-image: linear-gradient(@startColor, @midColor @colorStop, @endColor);
389
    background-repeat: no-repeat;
390
    filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@startColor),argb(@endColor))); // IE9 and down, gets no color-stop at all for proper fallback
391
  }
392
  .radial(@innerColor: #555, @outerColor: #333) {
393
394
395
396
    background-color: @outerColor;
    background-image: -webkit-gradient(radial, center center, 0, center center, 460, from(@innerColor), to(@outerColor));
    background-image: -webkit-radial-gradient(circle, @innerColor, @outerColor);
    background-image: -moz-radial-gradient(circle, @innerColor, @outerColor);
397
    background-image: -o-radial-gradient(circle, @innerColor, @outerColor);
398
399
    background-repeat: no-repeat;
  }
400
  .striped(@color: #555, @angle: 45deg) {
Piotrek Okoński's avatar
Piotrek Okoński committed
401
    background-color: @color;
402
403
404
405
406
    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));
    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);
    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);
    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);
    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);
Piotrek Okoński's avatar
Piotrek Okoński committed
407
  }
408
}
409
410
// Reset filters for IE
.reset-filter() {
411
  filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)"));
412
}
413

414

415
416
417
418

// COMPONENT MIXINS
// --------------------------------------------------

419
// Horizontal dividers
420
421
// -------------------------
// Dividers (basically an hr) within dropdowns and nav lists
422
.nav-divider(@top: #e5e5e5, @bottom: @white) {
Jacob Thornton's avatar
Jacob Thornton committed
423
  height: 1px;
424
  margin: ((@line-height-base / 2) - 1) 1px; // 8px 1px
Jacob Thornton's avatar
Jacob Thornton committed
425
  overflow: hidden;
426
427
  background-color: @top;
  border-bottom: 1px solid @bottom;
428
429
}

430
// Button backgrounds
431
// ------------------
Mark Otto's avatar
Mark Otto committed
432
433
.buttonBackground(@startColor, @endColor, @text-color: #fff, @textShadow: 0 -1px 0 rgba(0,0,0,.25)) {
  color: @text-color;
Mark Otto's avatar
Mark Otto committed
434
435
436
437
  text-shadow: @textShadow;
  #gradient > .vertical(@startColor, @endColor);
  border-color: @endColor @endColor darken(@endColor, 15%);
  border-color: rgba(0,0,0,.1) rgba(0,0,0,.1) fadein(rgba(0,0,0,.1), 15%);
Jacob Thornton's avatar
Jacob Thornton committed
438
  .reset-filter();
439
440

  // in these cases the gradient won't cover the background, so we override
441
  &:hover, &:active, &.active, &.disabled, &[disabled] {
Mark Otto's avatar
Mark Otto committed
442
    color: @text-color;
443
444
445
    background-color: @endColor;
  }

Mark Otto's avatar
Mark Otto committed
446
  // IE8 can't handle box-shadow to show active, so we darken a bit ourselves
447
448
449
450
451
452
  &:active,
  &.active {
    background-color: darken(@endColor, 10%) e("\9");
  }
}

Mark Otto's avatar
Mark Otto committed
453

454
455
456
457
458
459
460
461
// Navbar vertical align
// -------------------------
// Vertically center elements in the navbar.
// Example: an element has a height of 30px, so write out `.navbarVerticalAlign(30px);` to calculate the appropriate top margin.
.navbarVerticalAlign(@elementHeight) {
  margin-top: (@navbarHeight - @elementHeight) / 2;
}

462

463
464
465
466

// Grid System
// -----------

467
// Centered container element
468
469
.container-fixed() {
  margin-right: auto;
Jacob Thornton's avatar
Jacob Thornton committed
470
  margin-left: auto;
471
472
473
  .clearfix();
}

474
475
476
477
478
479
// Make a Grid
// Use .makeRow and .makeColumn to assign semantic layouts grid system behavior
.makeRow() {
  margin-left: @gridGutterWidth * -1;
  .clearfix();
}
480
.makeColumn(@columns: 1, @offset: 0) {
481
  float: left;
482
  margin-left: (@gridColumnWidth * @offset) + (@gridGutterWidth * (@offset - 1)) + (@gridGutterWidth * 2);
483
484
485
486
  width: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns - 1));
}

// The Grid
487
488
#grid {

Mark Otto's avatar
Mark Otto committed
489
  .core(@gridColumnWidth, @gridGutterWidth, @gridRowWidth) {
490

Mark Otto's avatar
Mark Otto committed
491
    .spanX(@index) when (@index > 0) {
492
493
494
      (~".span@{index}") { .span(@index); }
      .spanX(@index - 1);
    }
Mark Otto's avatar
Mark Otto committed
495
    .spanX(0) {}
496

Mark Otto's avatar
Mark Otto committed
497
    .offsetX(@index) when (@index > 0) {
498
499
      (~".offset@{index}") { .offset(@index); }
      .offsetX(@index - 1);
500
    }
Mark Otto's avatar
Mark Otto committed
501
    .offsetX(0) {}
502

Mark Otto's avatar
Mark Otto committed
503
504
505

    // Base styles
    .offset(@columns) {
506
      margin-left: percentage(@columns / @gridColumns);
507
    }
Mark Otto's avatar
Mark Otto committed
508
    .span(@columns) {
509
      width: percentage(@columns / @gridColumns);
510
511
    }

512
    .row {
Mark Otto's avatar
Mark Otto committed
513
      // Negative indent the columns so text lines up
514
515
      margin-left: @gridGutterWidth / -2;
      margin-right: @gridGutterWidth / -2;
Mark Otto's avatar
Mark Otto committed
516
      // Clear the floated columns
517
518
519
520
      .clearfix();
    }

    [class*="span"] {
Mark Otto's avatar
Mark Otto committed
521
522
      float: left; // Collapse whitespace
      min-height: 1px; // Prevent empty columns from collapsing
523
524
      padding-left: @gridGutterWidth / 2;
      padding-right: @gridGutterWidth / 2;
Mark Otto's avatar
Mark Otto committed
525
      // Proper box-model (padding doesnt' add to width)
526
527
528
      -webkit-box-sizing: border-box;
         -moz-box-sizing: border-box;
              box-sizing: border-box;
529
530
    }

Mark Otto's avatar
Mark Otto committed
531
532
533
    // Generate .spanX and .offsetX
    .spanX(@gridColumns);
    .offsetX(@gridColumns);
534
535
536

  }

537
538
539

  .input(@gridColumnWidth, @gridGutterWidth, @gridRowWidth) {

Mark Otto's avatar
Mark Otto committed
540
541
    .spanX(@index) when (@index > 0) {
      (~"input.span@{index}, textarea.span@{index}, select.span@{index}, .uneditable-input.span@{index}") { .span(@index); }
542
543
      .spanX(@index - 1);
    }
Mark Otto's avatar
Mark Otto committed
544
    .spanX(0) {}
Mark Otto's avatar
Mark Otto committed
545

Mark Otto's avatar
Mark Otto committed
546
547
548
549
550
    .offsetX(@index) when (@index > 0) {
      (~"input.offset@{index}, textarea.offset@{index}, select.offset@{index}, uneditable-input.offset@{index}") { .offset(@index); }
      .offsetX(@index - 1);
    }
    .offsetX(0) {}
Mark Otto's avatar
Mark Otto committed
551

Mark Otto's avatar
Mark Otto committed
552
    .span(@columns) {
Mark Otto's avatar
Mark Otto committed
553
      // TODO: Figure out how to add this back behind a class
Mark Otto's avatar
Mark Otto committed
554
      // Part 1: Since inputs require padding *and* margin, we subtract the grid gutter width, as a percent of the row, from the default column width.
Mark Otto's avatar
Mark Otto committed
555
      //width: percentage(@columns / @gridColumns) - percentage(@gridGutterWidth / @gridRowWidth);
Mark Otto's avatar
Mark Otto committed
556
      // Part 2: That subtracted width then gets split in half and added to the left and right margins.
Mark Otto's avatar
Mark Otto committed
557
558
      // margin-left: percentage((@gridGutterWidth / 2) / @gridRowWidth);
      // margin-right: percentage((@gridGutterWidth / 2) / @gridRowWidth);
559
560
    }

Mark Otto's avatar
Mark Otto committed
561
562
563
    .offset(@columns) {
      // Take the normal offset margin and add an extra gutter's worth.
      margin-left: percentage(@columns / @gridColumns) + percentage((@gridGutterWidth / 2) / @gridRowWidth);
564
565
    }

Mark Otto's avatar
Mark Otto committed
566
567
568
    // Generate .spanX and .offsetX
    .spanX(@gridColumns);
    .offsetX(@gridColumns);
569
570
571
572

  }


573
}