aboutsummaryrefslogtreecommitdiff
path: root/less/dropdowns.less
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2013-12-15 14:09:50 -0800
committerMark Otto <[email protected]>2013-12-15 14:09:50 -0800
commit55f6beb4278979155549e17da6e87a2548ec0b88 (patch)
treefde6fd0482a5f244433d280080b235a9d229c7e3 /less/dropdowns.less
parent0c457d48f85ad637d9c47b5167b83e8de2b868d6 (diff)
parent56eecf97ac21e5b6111563f726ad7860cd76f0f0 (diff)
downloadbootstrap-55f6beb4278979155549e17da6e87a2548ec0b88.tar.xz
bootstrap-55f6beb4278979155549e17da6e87a2548ec0b88.zip
Merge branch 'master' into pr/11776
Conflicts: package.json
Diffstat (limited to 'less/dropdowns.less')
-rw-r--r--less/dropdowns.less30
1 files changed, 28 insertions, 2 deletions
diff --git a/less/dropdowns.less b/less/dropdowns.less
index 1a8f1973f..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;
@@ -142,7 +163,7 @@
right: 0;
bottom: 0;
top: 0;
- z-index: @zindex-dropdown - 10;
+ z-index: (@zindex-dropdown - 10);
}
// Right aligned dropdowns
@@ -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();
}
}
}