aboutsummaryrefslogtreecommitdiff
path: root/less/dropdowns.less
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2013-12-15 11:16:57 -0800
committerMark Otto <[email protected]>2013-12-15 11:16:57 -0800
commitfd62247bf8bbb1bce072f5ee03e996dfc4abed94 (patch)
tree487766325e03d40c7af16c58873b70d8638a72ba /less/dropdowns.less
parentfbf31f965e27a6665c7e0f2d97eb74c0df7585d4 (diff)
parent2b86e05a6150ef13905519070ea82ce895fbae85 (diff)
downloadbootstrap-fd62247bf8bbb1bce072f5ee03e996dfc4abed94.tar.xz
bootstrap-fd62247bf8bbb1bce072f5ee03e996dfc4abed94.zip
Merge branch 'master' into cover_template
Diffstat (limited to 'less/dropdowns.less')
-rw-r--r--less/dropdowns.less28
1 files changed, 27 insertions, 1 deletions
diff --git a/less/dropdowns.less b/less/dropdowns.less
index 4bdc223fc..dde2038e3 100644
--- a/less/dropdowns.less
+++ b/less/dropdowns.less
@@ -46,6 +46,8 @@
background-clip: padding-box;
// Aligns the dropdown menu to right
+ //
+ // Deprecated as of 3.1 in favor of `.dropdown-menu-[dir]`
&.pull-right {
right: 0;
left: auto;
@@ -126,6 +128,25 @@
}
}
+// 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;
@@ -180,7 +201,12 @@
@media (min-width: @grid-float-breakpoint) {
.navbar-right {
.dropdown-menu {
- .pull-right > .dropdown-menu();
+ .dropdown-menu-right();
+ }
+ // Necessary for overrides of the default right aligned menu.
+ // Will remove come v4 in all likelihood.
+ .dropdown-menu-left {
+ .dropdown-menu-left();
}
}
}