aboutsummaryrefslogtreecommitdiff
path: root/scss/_navbar.scss
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2019-08-05 12:12:16 -0700
committerGitHub <[email protected]>2019-08-05 12:12:16 -0700
commitd94148bf50eb3281f8c951517d4de56ec9ecbc2e (patch)
tree0f86255134501267e11ae4adc4220d69b94df081 /scss/_navbar.scss
parent8c362f0a0abd9395ac3327d136b07546e3082656 (diff)
downloadbootstrap-d94148bf50eb3281f8c951517d4de56ec9ecbc2e.tar.xz
bootstrap-d94148bf50eb3281f8c951517d4de56ec9ecbc2e.zip
Responsive containers (follow-up to #29095) (#29118)
* Follow-up to #29095 This PR fixes the responsive containers that were added in #29095, originally stubbed out in #25631. Apologies to @browner12 for getting that wrong. Fixes #25631. * update navbar as well because we cannot reset all containers uniformly * Update navbars example to include container-xl example to ensure containers match * rewrite responsive containers docs, add table of max-widths * Update container docs - Move table up to the intro - Remove the container example because it's actually hella confusing - Update and link to grid example as a demo instead
Diffstat (limited to 'scss/_navbar.scss')
-rw-r--r--scss/_navbar.scss39
1 files changed, 36 insertions, 3 deletions
diff --git a/scss/_navbar.scss b/scss/_navbar.scss
index 64c15f534..f9e2b792a 100644
--- a/scss/_navbar.scss
+++ b/scss/_navbar.scss
@@ -25,12 +25,23 @@
// Because flex properties aren't inherited, we need to redeclare these first
// few properties so that content nested within behave properly.
- > [class^="container"] {
+ %container-flex-properties {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
}
+
+ .container,
+ .container-fluid {
+ @extend %container-flex-properties;
+ }
+
+ @each $breakpoint, $container-max-width in $container-max-widths {
+ > .container#{breakpoint-infix($breakpoint, $container-max-widths)} {
+ @extend %container-flex-properties;
+ }
+ }
}
@@ -139,10 +150,21 @@
&#{$infix} {
@include media-breakpoint-down($breakpoint) {
- > [class^="container"] {
+ %container-navbar-expand-#{$breakpoint} {
padding-right: 0;
padding-left: 0;
}
+
+ > .container,
+ > .container-fluid {
+ @extend %container-navbar-expand-#{$breakpoint};
+ }
+
+ @each $size, $container-max-width in $container-max-widths {
+ > .container#{breakpoint-infix($size, $container-max-widths)} {
+ @extend %container-navbar-expand-#{$breakpoint};
+ }
+ }
}
@include media-breakpoint-up($next) {
@@ -163,10 +185,21 @@
}
// For nesting containers, have to redeclare for alignment purposes
- > [class^="container"] {
+ %container-nesting-#{$breakpoint} {
flex-wrap: nowrap;
}
+ > .container,
+ > .container-fluid {
+ @extend %container-nesting-#{$breakpoint};
+ }
+
+ @each $size, $container-max-width in $container-max-widths {
+ > .container#{breakpoint-infix($size, $container-max-widths)} {
+ @extend %container-nesting-#{$breakpoint};
+ }
+ }
+
.navbar-collapse {
display: flex !important; // stylelint-disable-line declaration-no-important