Layout von Websiten mit Bootstrap und Foundation
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

_grid-framework.scss 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. width: 100%;
  10. padding-right: $gutter / 2;
  11. padding-left: $gutter / 2;
  12. }
  13. @each $breakpoint in map-keys($breakpoints) {
  14. $infix: breakpoint-infix($breakpoint, $breakpoints);
  15. @if $columns > 0 {
  16. // Allow columns to stretch full width below their breakpoints
  17. @for $i from 1 through $columns {
  18. .col#{$infix}-#{$i} {
  19. @extend %grid-column;
  20. }
  21. }
  22. }
  23. .col#{$infix},
  24. .col#{$infix}-auto {
  25. @extend %grid-column;
  26. }
  27. @include media-breakpoint-up($breakpoint, $breakpoints) {
  28. // Provide basic `.col-{bp}` classes for equal-width flexbox columns
  29. .col#{$infix} {
  30. flex-basis: 0;
  31. flex-grow: 1;
  32. min-width: 0; // See https://github.com/twbs/bootstrap/issues/25410
  33. max-width: 100%;
  34. }
  35. @if $grid-row-columns > 0 {
  36. @for $i from 1 through $grid-row-columns {
  37. .row-cols#{$infix}-#{$i} {
  38. @include row-cols($i);
  39. }
  40. }
  41. }
  42. .col#{$infix}-auto {
  43. @include make-col-auto();
  44. }
  45. @if $columns > 0 {
  46. @for $i from 1 through $columns {
  47. .col#{$infix}-#{$i} {
  48. @include make-col($i, $columns);
  49. }
  50. }
  51. }
  52. .order#{$infix}-first { order: -1; }
  53. .order#{$infix}-last { order: $columns + 1; }
  54. @for $i from 0 through $columns {
  55. .order#{$infix}-#{$i} { order: $i; }
  56. }
  57. @if $columns > 0 {
  58. // `$columns - 1` because offsetting by the width of an entire row isn't possible
  59. @for $i from 0 through ($columns - 1) {
  60. @if not ($infix == "" and $i == 0) { // Avoid emitting useless .offset-0
  61. .offset#{$infix}-#{$i} {
  62. @include make-col-offset($i, $columns);
  63. }
  64. }
  65. }
  66. }
  67. }
  68. }
  69. }