_grid.scss 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. // Container widths
  2. //
  3. // Set the container width, and override it for fixed navbars in media queries.
  4. @if $enable-grid-classes {
  5. // Single container class with breakpoint max-widths
  6. .container,
  7. // 100% wide container at all breakpoints
  8. .container-fluid {
  9. @include make-container();
  10. }
  11. // Responsive containers that are 100% wide until a breakpoint
  12. @each $breakpoint, $container-max-width in $container-max-widths {
  13. .container-#{$breakpoint} {
  14. @extend .container-fluid;
  15. }
  16. @include media-breakpoint-up($breakpoint, $grid-breakpoints) {
  17. %responsive-container-#{$breakpoint} {
  18. max-width: $container-max-width;
  19. }
  20. // Extend each breakpoint which is smaller or equal to the current breakpoint
  21. $extend-breakpoint: true;
  22. @each $name, $width in $grid-breakpoints {
  23. @if ($extend-breakpoint) {
  24. .container#{breakpoint-infix($name, $grid-breakpoints)} {
  25. @extend %responsive-container-#{$breakpoint};
  26. }
  27. // Once the current breakpoint is reached, stop extending
  28. @if ($breakpoint == $name) {
  29. $extend-breakpoint: false;
  30. }
  31. }
  32. }
  33. }
  34. }
  35. }
  36. // Row
  37. //
  38. // Rows contain your columns.
  39. @if $enable-grid-classes {
  40. .row {
  41. @include make-row();
  42. }
  43. // Remove the negative margin from default .row, then the horizontal padding
  44. // from all immediate children columns (to prevent runaway style inheritance).
  45. .no-gutters {
  46. margin-right: 0;
  47. margin-left: 0;
  48. > .col,
  49. > [class*="col-"] {
  50. padding-right: 0;
  51. padding-left: 0;
  52. }
  53. }
  54. }
  55. // Columns
  56. //
  57. // Common styles for small and large grid columns
  58. @if $enable-grid-classes {
  59. @include make-grid-columns();
  60. }