From 5a0365524d8a190c718bcb4950c423c9bef75bd9 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sun, 1 Dec 2013 19:27:33 -0800 Subject: Rework navbar padding and margins for right aligned last-child elements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This slight reworking of the navbar spacing was brought about by a problem noted in #11530: use of `.navbar-form.navbar-right` leaves an extra 15px of space on the right. Here’s what’s new: * Removed the `padding` on `.navbar-collapse` within static top, fixed top, and fixed bottom navbars. Meaning, it’s still there for the default navbar. This was the root cause of the extra 15px padding for navbar forms. * As part of this, I also replaced the existing negative margin overrides for last-child elements with more contextual ones within their sub-components. Overall not too different, but should be more effective now and easier to work with now. For example of new changes, see http://jsbin.com/odeSiSo/1/. --- dist/css/bootstrap.css | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'dist/css/bootstrap.css') diff --git a/dist/css/bootstrap.css b/dist/css/bootstrap.css index b4fdb28ab..6351224b8 100644 --- a/dist/css/bootstrap.css +++ b/dist/css/bootstrap.css @@ -4426,14 +4426,11 @@ textarea.input-group-sm > .input-group-btn > .btn { .navbar-collapse.in { overflow-y: auto; } - .navbar-collapse .navbar-nav.navbar-left:first-child { - margin-left: -15px; - } - .navbar-collapse .navbar-nav.navbar-right:last-child { - margin-right: -15px; - } - .navbar-collapse .navbar-text:last-child { - margin-right: 0; + .navbar-fixed-top .navbar-collapse, + .navbar-static-top .navbar-collapse, + .navbar-fixed-bottom .navbar-collapse { + padding-right: 0; + padding-left: 0; } } @@ -4581,6 +4578,9 @@ textarea.input-group-sm > .input-group-btn > .btn { padding-top: 15px; padding-bottom: 15px; } + .navbar-nav.navbar-right:last-child { + margin-right: -15px; + } } @media (min-width: 768px) { @@ -4647,6 +4647,9 @@ textarea.input-group-sm > .input-group-btn > .btn { -webkit-box-shadow: none; box-shadow: none; } + .navbar-form.navbar-right:last-child { + margin-right: -15px; + } } .navbar-nav > li > .dropdown-menu { @@ -4692,6 +4695,9 @@ textarea.input-group-sm > .input-group-btn > .btn { margin-right: 15px; margin-left: 15px; } + .navbar-text.navbar-right:last-child { + margin-right: 0; + } } .navbar-default { -- cgit v1.2.3