vendor/assets/stylesheets/bootstrap/_dropdowns.scss in bootstrap-sass-3.0.3.0 vs vendor/assets/stylesheets/bootstrap/_dropdowns.scss in bootstrap-sass-3.1.0.0

- old
+ new

@@ -44,10 +44,12 @@ border-radius: $border-radius-base; @include box-shadow(0 6px 12px rgba(0,0,0,.175)); background-clip: padding-box; // Aligns the dropdown menu to right + // + // Deprecated as of 3.1.0 in favor of `.dropdown-menu-[dir]` &.pull-right { right: 0; left: auto; } @@ -124,10 +126,29 @@ > a { outline: 0; } } +// Menu positioning +// +// Add extra class to `.dropdown-menu` to flip the alignment of the dropdown +// menu with the parent. +.dropdown-menu-right { + left: auto; // Reset the default from `.dropdown-menu` + right: 0; +} +// With v3, we enabled auto-flipping if you have a dropdown within a right +// aligned nav component. To enable the undoing of that, we provide an override +// to restore the default dropdown menu alignment. +// +// This is only for left-aligning a dropdown menu within a `.navbar-right` or +// `.pull-right` nav component. +.dropdown-menu-left { + left: 0; + right: auto; +} + // Dropdown section headers .dropdown-header { display: block; padding: 3px 20px; font-size: $font-size-small; @@ -140,11 +161,11 @@ position: fixed; left: 0; right: 0; bottom: 0; top: 0; - z-index: $zindex-dropdown - 10; + z-index: ($zindex-dropdown - 10); } // Right aligned dropdowns .pull-right > .dropdown-menu { right: 0; @@ -178,11 +199,15 @@ // Reiterate per navbar.less and the modified component alignment there. @media (min-width: $grid-float-breakpoint) { .navbar-right { .dropdown-menu { - right: 0; - left: auto; + right: 0; left: auto; + } + // Necessary for overrides of the default right aligned menu. + // Will remove come v4 in all likelihood. + .dropdown-menu-left { + left: 0; right: auto; } } }