1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-30 16:50:00 +02:00

v5: Simplify navbars by requiring containers (#29339)

* v5: Simplify navbars by requiring containers

* Update migration docs for navbar
This commit is contained in:
Mark Otto
2019-10-27 20:26:52 -07:00
committed by GitHub
parent 23c3cdbd43
commit 9c7bc1a111
5 changed files with 574 additions and 515 deletions

View File

@@ -21,7 +21,10 @@
flex-wrap: wrap; // allow us to do the line break for collapsing content
align-items: center;
justify-content: space-between; // space out brand from logo
padding: $navbar-padding-y $navbar-padding-x;
padding-top: $navbar-padding-y;
padding-right: $navbar-padding-x; // default: null
padding-bottom: $navbar-padding-y;
padding-left: $navbar-padding-x; // default: null
// Because flex properties aren't inherited, we need to redeclare these first
// few properties so that content nested within behave properly.
@@ -149,24 +152,6 @@
$infix: breakpoint-infix($next, $grid-breakpoints);
&#{$infix} {
@include media-breakpoint-down($breakpoint) {
%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) {
flex-flow: row nowrap;
justify-content: flex-start;

View File

@@ -833,7 +833,7 @@ $nav-pills-link-active-bg: $component-active-bg !default;
// Navbar
$navbar-padding-y: $spacer / 2 !default;
$navbar-padding-x: $spacer !default;
$navbar-padding-x: null !default;
$navbar-nav-link-padding-x: .5rem !default;