e73726944ac7b9216f139c977652067efcde6bdd.svn-base 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Framework grid generation
  2. //
  3. // Used only by Bootstrap to generate the correct number of grid classes given
  4. // any value of `$grid-columns`.
  5. @mixin make-grid-columns($columns: $grid-columns, $gutter: $grid-gutter-width, $breakpoints: $grid-breakpoints) {
  6. // Common properties for all breakpoints
  7. %grid-column {
  8. position: relative;
  9. // Prevent columns from collapsing when empty
  10. min-height: 1px;
  11. // Inner gutter via padding
  12. padding-left: ($gutter / 2);
  13. padding-right: ($gutter / 2);
  14. }
  15. @each $breakpoint in map-keys($breakpoints) {
  16. @for $i from 1 through $columns {
  17. .col-#{$breakpoint}-#{$i} {
  18. @extend %grid-column;
  19. }
  20. }
  21. @include media-breakpoint-up($breakpoint) {
  22. // Work around cross-media @extend (https://github.com/sass/sass/issues/1050)
  23. %grid-column-float-#{$breakpoint} {
  24. @if $enable-flex {
  25. // Do nothing
  26. } @else {
  27. float: left;
  28. }
  29. }
  30. @for $i from 1 through $columns {
  31. .col-#{$breakpoint}-#{$i} {
  32. @extend %grid-column-float-#{$breakpoint};
  33. @include make-col-span($i, $columns);
  34. }
  35. }
  36. @each $modifier in (pull, push, offset) {
  37. @for $i from 0 through $columns {
  38. .col-#{$breakpoint}-#{$modifier}-#{$i} {
  39. @include make-col-modifier($modifier, $i, $columns)
  40. }
  41. }
  42. }
  43. }
  44. }
  45. }