UNPKG

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