Skip to content

Commit

Permalink
Merge pull request #14051 from loic/issue13325
Browse files Browse the repository at this point in the history
Address margins on .navbar-right to fix #13325 #13464.
  • Loading branch information
mdo committed Jul 7, 2014
2 parents 907b3b2 + e88fa90 commit 6f88238
Showing 1 changed file with 19 additions and 23 deletions.
42 changes: 19 additions & 23 deletions less/navbar.less
Original file line number Diff line number Diff line change
Expand Up @@ -275,26 +275,10 @@
padding-bottom: @navbar-padding-vertical;
}
}

&.navbar-right:first-child {
margin-right: -@navbar-padding-horizontal;
}
}
}


// Component alignment
//
// Repurpose the pull utilities as their own navbar utilities to avoid specificity
// issues with parents and chaining. Only do this when the navbar is uncollapsed
// though so that navbar contents properly stack and align in mobile.

@media (min-width: @grid-float-breakpoint) {
.navbar-left { .pull-left(); }
.navbar-right { .pull-right(); }
}


// Navbar form
//
// Extension of the `.form-inline` with some extra flavor for optimum display in
Expand Down Expand Up @@ -330,11 +314,6 @@
padding-top: 0;
padding-bottom: 0;
.box-shadow(none);

// Outdent the form if first child to line up with content down the page
&.navbar-right:first-child {
margin-right: -@navbar-padding-horizontal;
}
}
}

Expand Down Expand Up @@ -379,14 +358,31 @@
float: left;
margin-left: @navbar-padding-horizontal;
margin-right: @navbar-padding-horizontal;
}
}

// Outdent the form if first child to line up with content down the page
&.navbar-right:first-child {

// Component alignment
//
// Repurpose the pull utilities as their own navbar utilities to avoid specificity
// issues with parents and chaining. Only do this when the navbar is uncollapsed
// though so that navbar contents properly stack and align in mobile.
//
// Declared after the navbar components to ensure more specificity on the margins.

@media (min-width: @grid-float-breakpoint) {
.navbar-left { .pull-left(); }
.navbar-right {
.pull-right();
margin-right: -@navbar-padding-horizontal;

~ .navbar-right {
margin-right: 0;
}
}
}


// Alternate navbars
// --------------------------------------------------

Expand Down

0 comments on commit 6f88238

Please sign in to comment.