3 // --------------------------------------------------
6 // Wrapper and base class
8 // Provide a static navbar from which we expand to create full-width, fixed, and
9 // other navbar variations.
13 min-height: $navbar-height; // Ensure a navbar always shows (e.g., without a .navbar-brand in collapsed mode)
14 margin-bottom: $navbar-margin-bottom;
15 border: 1px solid transparent;
17 // Prevent floats from breaking the navbar
20 @media (min-width: $grid-float-breakpoint) {
21 border-radius: $navbar-border-radius;
28 // Groups `.navbar-brand` and `.navbar-toggle` into a single component for easy
29 // styling of responsive aspects.
34 @media (min-width: $grid-float-breakpoint) {
40 // Navbar collapse (body)
42 // Group your navbar content into this for easy collapsing and expanding across
43 // various device sizes. By default, this content is collapsed when <768px, but
44 // will expand past that for a horizontal display.
46 // To start (on mobile devices) the navbar links, forms, and buttons are stacked
47 // vertically and include a `max-height` to overflow in case you have too much
48 // content for the user's viewport.
52 padding-right: $navbar-padding-horizontal;
53 padding-left: $navbar-padding-horizontal;
54 border-top: 1px solid transparent;
55 box-shadow: inset 0 1px 0 rgba(255,255,255,.1);
57 -webkit-overflow-scrolling: touch;
63 @media (min-width: $grid-float-breakpoint) {
69 display: block !important;
70 height: auto !important;
71 padding-bottom: 0; // Override default setting
72 overflow: visible !important;
79 // Undo the collapse side padding for navbars with containers to ensure
80 // alignment of right-aligned contents.
83 .navbar-fixed-bottom & {
91 .navbar-fixed-bottom {
93 max-height: $navbar-collapse-max-height;
95 @media (max-device-width: $screen-xs-min) and (orientation: landscape) {
102 // Both navbar header and collapse
104 // When a container is present, change the behavior of the header and collapse.
110 margin-right: -$navbar-padding-horizontal;
111 margin-left: -$navbar-padding-horizontal;
113 @media (min-width: $grid-float-breakpoint) {
122 // Navbar alignment options
124 // Display the navbar across the entirety of the page or fixed it to the top or
125 // bottom of the page.
127 // Static top (unfixed, but 100% wide) navbar
129 z-index: $zindex-navbar;
130 border-width: 0 0 1px;
132 @media (min-width: $grid-float-breakpoint) {
137 // Fix the top/bottom navbars when screen real estate supports it
139 .navbar-fixed-bottom {
143 z-index: $zindex-navbar-fixed;
145 // Undo the rounded corners
146 @media (min-width: $grid-float-breakpoint) {
152 border-width: 0 0 1px;
154 .navbar-fixed-bottom {
156 margin-bottom: 0; // override .navbar defaults
157 border-width: 1px 0 0;
161 // Brand/project name
165 padding: $navbar-padding-vertical $navbar-padding-horizontal;
166 font-size: $font-size-large;
167 line-height: $line-height-computed;
168 height: $navbar-height;
172 text-decoration: none;
179 @media (min-width: $grid-float-breakpoint) {
180 .navbar > .container &,
181 .navbar > .container-fluid & {
182 margin-left: -$navbar-padding-horizontal;
190 // Custom button for toggling the `.navbar-collapse`, powered by the collapse
191 // JavaScript plugin.
196 margin-right: $navbar-padding-horizontal;
198 @include navbar-vertical-align(34px);
199 background-color: transparent;
200 background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214
201 border: 1px solid transparent;
202 border-radius: $border-radius-base;
204 // We remove the `outline` here, but later compensate by attaching `:hover`
205 // styles to `:focus`.
217 .icon-bar + .icon-bar {
221 @media (min-width: $grid-float-breakpoint) {
229 // Builds on top of the `.nav` components with its own modifier class to make
230 // the nav the full height of the horizontal nav (above 768px).
233 margin: ($navbar-padding-vertical / 2) (-$navbar-padding-horizontal);
237 padding-bottom: 10px;
238 line-height: $line-height-computed;
241 @media (max-width: $grid-float-breakpoint-max) {
242 // Dropdowns get custom display when collapsed
243 .open .dropdown-menu {
248 background-color: transparent;
253 padding: 5px 15px 5px 25px;
256 line-height: $line-height-computed;
259 background-image: none;
265 // Uncollapse the nav
266 @media (min-width: $grid-float-breakpoint) {
273 padding-top: $navbar-padding-vertical;
274 padding-bottom: $navbar-padding-vertical;
283 // Extension of the `.form-inline` with some extra flavor for optimum display in
287 margin-left: -$navbar-padding-horizontal;
288 margin-right: -$navbar-padding-horizontal;
289 padding: 10px $navbar-padding-horizontal;
290 border-top: 1px solid transparent;
291 border-bottom: 1px solid transparent;
292 $shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.1);
293 @include box-shadow($shadow);
295 // Mixin behavior for optimum display
296 @include form-inline;
299 @media (max-width: $grid-float-breakpoint-max) {
308 // Vertically center in expanded, horizontal navbar
309 @include navbar-vertical-align($input-height-base);
311 // Undo 100% width for pull classes
312 @media (min-width: $grid-float-breakpoint) {
319 @include box-shadow(none);
326 // Menu position and menu carets
327 .navbar-nav > li > .dropdown-menu {
329 @include border-top-radius(0);
331 // Menu position and menu caret support for dropups via extra dropup class
332 .navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {
334 @include border-top-radius($navbar-border-radius);
335 @include border-bottom-radius(0);
339 // Buttons in navbars
341 // Vertically center a button within a navbar (when *not* in a form).
344 @include navbar-vertical-align($input-height-base);
347 @include navbar-vertical-align($input-height-small);
350 @include navbar-vertical-align(22);
357 // Add a class to make any element properly align itself vertically within the navbars.
360 @include navbar-vertical-align($line-height-computed);
362 @media (min-width: $grid-float-breakpoint) {
364 margin-left: $navbar-padding-horizontal;
365 margin-right: $navbar-padding-horizontal;
370 // Component alignment
372 // Repurpose the pull utilities as their own navbar utilities to avoid specificity
373 // issues with parents and chaining. Only do this when the navbar is uncollapsed
374 // though so that navbar contents properly stack and align in mobile.
376 // Declared after the navbar components to ensure more specificity on the margins.
378 @media (min-width: $grid-float-breakpoint) {
380 float: left !important;
383 float: right !important;
384 margin-right: -$navbar-padding-horizontal;
394 // --------------------------------------------------
398 background-color: $navbar-default-bg;
399 border-color: $navbar-default-border;
402 color: $navbar-default-brand-color;
405 color: $navbar-default-brand-hover-color;
406 background-color: $navbar-default-brand-hover-bg;
411 color: $navbar-default-color;
416 color: $navbar-default-link-color;
420 color: $navbar-default-link-hover-color;
421 background-color: $navbar-default-link-hover-bg;
428 color: $navbar-default-link-active-color;
429 background-color: $navbar-default-link-active-bg;
436 color: $navbar-default-link-disabled-color;
437 background-color: $navbar-default-link-disabled-bg;
443 border-color: $navbar-default-toggle-border-color;
446 background-color: $navbar-default-toggle-hover-bg;
449 background-color: $navbar-default-toggle-icon-bar-bg;
455 border-color: $navbar-default-border;
458 // Dropdown menu items
460 // Remove background color from open dropdown
465 background-color: $navbar-default-link-active-bg;
466 color: $navbar-default-link-active-color;
470 @media (max-width: $grid-float-breakpoint-max) {
471 // Dropdowns get custom display when collapsed
472 .open .dropdown-menu {
474 color: $navbar-default-link-color;
477 color: $navbar-default-link-hover-color;
478 background-color: $navbar-default-link-hover-bg;
485 color: $navbar-default-link-active-color;
486 background-color: $navbar-default-link-active-bg;
493 color: $navbar-default-link-disabled-color;
494 background-color: $navbar-default-link-disabled-bg;
504 // Add a class to ensure links outside the navbar nav are colored correctly.
507 color: $navbar-default-link-color;
509 color: $navbar-default-link-hover-color;
514 color: $navbar-default-link-color;
517 color: $navbar-default-link-hover-color;
520 fieldset[disabled] & {
523 color: $navbar-default-link-disabled-color;
532 background-color: $navbar-inverse-bg;
533 border-color: $navbar-inverse-border;
536 color: $navbar-inverse-brand-color;
539 color: $navbar-inverse-brand-hover-color;
540 background-color: $navbar-inverse-brand-hover-bg;
545 color: $navbar-inverse-color;
550 color: $navbar-inverse-link-color;
554 color: $navbar-inverse-link-hover-color;
555 background-color: $navbar-inverse-link-hover-bg;
562 color: $navbar-inverse-link-active-color;
563 background-color: $navbar-inverse-link-active-bg;
570 color: $navbar-inverse-link-disabled-color;
571 background-color: $navbar-inverse-link-disabled-bg;
576 // Darken the responsive nav toggle
578 border-color: $navbar-inverse-toggle-border-color;
581 background-color: $navbar-inverse-toggle-hover-bg;
584 background-color: $navbar-inverse-toggle-icon-bar-bg;
590 border-color: darken($navbar-inverse-bg, 7%);
599 background-color: $navbar-inverse-link-active-bg;
600 color: $navbar-inverse-link-active-color;
604 @media (max-width: $grid-float-breakpoint-max) {
605 // Dropdowns get custom display
606 .open .dropdown-menu {
608 border-color: $navbar-inverse-border;
611 background-color: $navbar-inverse-border;
614 color: $navbar-inverse-link-color;
617 color: $navbar-inverse-link-hover-color;
618 background-color: $navbar-inverse-link-hover-bg;
625 color: $navbar-inverse-link-active-color;
626 background-color: $navbar-inverse-link-active-bg;
633 color: $navbar-inverse-link-disabled-color;
634 background-color: $navbar-inverse-link-disabled-bg;
642 color: $navbar-inverse-link-color;
644 color: $navbar-inverse-link-hover-color;
649 color: $navbar-inverse-link-color;
652 color: $navbar-inverse-link-hover-color;
655 fieldset[disabled] & {
658 color: $navbar-inverse-link-disabled-color;