twitter/bootstrap — pull request #2907 by tierra (2012-04-02 09:07:28+00:00)
Title: Restrict collapsed items in Navbar to only those in .nav-collapse, and buttons in Navbar.

Also fix styles for buttons in the Navbar for proper spacing and alignment along with their Navbar-specific dropdown styles.

This is completed work based on issue #2895. There are two distinct parts to this pull request.

First, nav items in the Navbar are now specifically scoped so that only items contained in `.nav-collapse` are actually collapsed and hidden in < 980px screens rather than all nav items. This change was required to implement the second part of this feature.

The second part adds appropriate Navbar-specific styles to buttons so that they can be used in the Navbar. There is one caveat to this feature though.

* Unfortunately anchor buttons could not be supported (only `input.btn`, `button.btn` and `.btn-group` is supported). The Navbar contains numerous customized anchor styles that override the base button styles effectively killing anchor buttons in the Navbar. Hopefully someone else can figure out a clean fix for this in the future.

I have modified the `fluid.html` example to use a button dropdown in place of the `navbar-text` to illustrate a useful account dropdown that remains shown in responsive designs even on mobile screens.

For whoever is reviewing these changes, I should also explain that the extra `li.dropdown` scope added to dropdown styles were only to styles meant specifically for `.nav` dropdowns, but not button dropdowns (mostly dealing with the appearance of the caret). The added scope makes it possible to add button dropdowns either outside or inside of a `.nav` item without any issues or differences, which might be desired depending on the Navbar layout.