Skip to content

Commit 6cb7829

Browse files
committed
Container-{breakpoint} generated only if $enable-bootstrap-compatibility is true. Re-integrate the documentation for $enable-bootstrap-compatibility, with the generation of xxl breakpoint.
1 parent 4fdcd73 commit 6cb7829

File tree

6 files changed

+269
-256
lines changed

6 files changed

+269
-256
lines changed

scss/_containers.scss

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,49 @@
33
// Set the container width, and override it for fixed navbars in media queries.
44

55
@if $enable-container-classes {
6-
// Single container class with breakpoint max-widths
7-
.container,
86
// 100% wide container at all breakpoints
97
.container-fluid {
108
@include make-container();
119
}
1210

13-
// Responsive containers that are 100% wide until a breakpoint
14-
@each $breakpoint, $container-max-width in $container-max-widths {
15-
.container-#{$breakpoint} {
16-
@extend .container-fluid;
11+
@if $enable-bootstrap-compatibility { // OUDS mod
12+
// OUDS mod
13+
// Single container class with breakpoint max-widths
14+
.container {
15+
@include make-container();
1716
}
17+
// End mod
1818

19-
@include media-breakpoint-up($breakpoint, $grid-breakpoints) {
20-
%responsive-container-#{$breakpoint} {
21-
max-width: $container-max-width;
19+
// Responsive containers that are 100% wide until a breakpoint
20+
@each $breakpoint, $container-max-width in $container-max-widths {
21+
.container-#{$breakpoint} {
22+
@extend .container-fluid;
2223
}
2324

24-
// Extend each breakpoint which is smaller or equal to the current breakpoint
25-
$extend-breakpoint: true;
25+
@include media-breakpoint-up($breakpoint, $grid-breakpoints) {
26+
%responsive-container-#{$breakpoint} {
27+
max-width: $container-max-width;
28+
}
2629

27-
@each $name, $width in $grid-breakpoints {
28-
@if ($extend-breakpoint) {
29-
.container#{breakpoint-infix($name, $grid-breakpoints)} {
30-
@extend %responsive-container-#{$breakpoint};
31-
}
30+
// Extend each breakpoint which is smaller or equal to the current breakpoint
31+
$extend-breakpoint: true;
32+
33+
@each $name, $width in $grid-breakpoints {
34+
@if ($extend-breakpoint) {
35+
.container#{breakpoint-infix($name, $grid-breakpoints)} {
36+
@extend %responsive-container-#{$breakpoint};
37+
}
3238

33-
// Once the current breakpoint is reached, stop extending
34-
@if ($breakpoint == $name) {
35-
$extend-breakpoint: false;
39+
// Once the current breakpoint is reached, stop extending
40+
@if ($breakpoint == $name) {
41+
$extend-breakpoint: false;
42+
}
3643
}
3744
}
3845
}
3946
}
4047
}
4148

42-
// OUDS mod
4349
// scss-docs-start containers-max
4450
.container-max-width {
4551
@include media-breakpoint-up(get-breakpoint-from-width()) {

scss/_functions.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// Do nothing
1313
} @else if not comparable($prev-num, $num) {
1414
@warn "Potentially invalid value for #{$map-name}: This map must be in ascending order, but key '#{$key}' has value #{$num} whose unit makes it incomparable to #{$prev-num}, the value of the previous key '#{$prev-key}' !";
15-
} @else if $prev-num >= $num {
15+
} @else if $prev-num > $num {
1616
@warn "Invalid value for #{$map-name}: This map must be in ascending order, but key '#{$key}' has value #{$num} which isn't greater than #{$prev-num}, the value of the previous key '#{$prev-key}' !";
1717
}
1818
$prev-key: $key;

scss/_maps.scss

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,6 @@ $grid-gutter-widths: (
194194
) !default;
195195
// scss-docs-end grid-gutters
196196

197-
@if $enable-bootstrap-compatibility {
198-
// Copy 2xl breakpoint into xxl breakpoint
199-
$gutters: map-merge($gutters, ("xxl": map-get($gutters, "2xl")));
200-
}
201-
202197
// scss-docs-start gutters
203198
$gutters: (
204199
none: 0,
@@ -216,6 +211,10 @@ $gutters: (
216211
) !default;
217212
// scss-docs-end gutters
218213

214+
@if $enable-bootstrap-compatibility {
215+
// Add Bootstrap gutters
216+
$gutters: map-merge($gutters, $spacers);
217+
}
219218
// End mod
220219

221220
$alert-colors: map-remove($theme-colors, "primary", "secondary", "light", "dark") !default; // OUDS mod

scss/_variables.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,11 @@ $grid-breakpoints: (
564564

565565
@if $enable-bootstrap-compatibility {
566566
// Copy 2xl breakpoint into xxl breakpoint
567-
$grid-breakpoints: map-merge($grid-breakpoints, ("xxl": map-get($grid-breakpoints, "2xl")));
567+
$breakpoint-2xl: map-get($grid-breakpoints, 2xl);
568+
$breakpoint-3xl: map-get($grid-breakpoints, 3xl);
569+
$grid-breakpoints: map-remove($grid-breakpoints, 2xl, 3xl);
570+
$grid-breakpoints: map-merge($grid-breakpoints, (xxl: $breakpoint-2xl, 2xl: $breakpoint-2xl, 3xl: $breakpoint-3xl));
571+
@debug $grid-breakpoints;
568572
}
569573

570574
@include _assert-ascending($grid-breakpoints, "$grid-breakpoints");

0 commit comments

Comments
 (0)