Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v5: Simplify navbars by requiring containers #29339

Merged
merged 2 commits into from
Oct 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 4 additions & 19 deletions scss/_navbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Loading