dropdowns-rtl.less 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. //
  2. // RTL Dropdown menus
  3. // --------------------------------------------------
  4. // Dropdown arrow/caret
  5. .caret {
  6. margin-right: 2px;
  7. margin-left: 0;
  8. }
  9. // The dropdown menu (ul)
  10. .dropdown-menu {
  11. right: 0;
  12. left: auto;
  13. float: left;
  14. text-align: right; // Ensures proper alignment if parent has it changed (e.g., modal footer)
  15. // Aligns the dropdown menu to right
  16. //
  17. // Deprecated as of 3.1.0 in favor of `.dropdown-menu-[dir]`
  18. &.pull-right {
  19. left: 0;
  20. right: auto;
  21. float: right;
  22. }
  23. }
  24. // Menu positioning
  25. //
  26. // Add extra class to `.dropdown-menu` to flip the alignment of the dropdown
  27. // menu with the parent.
  28. .dropdown-menu-right {
  29. left: auto; // Reset the default from `.dropdown-menu`
  30. right: 0;
  31. }
  32. // With v3, we enabled auto-flipping if you have a dropdown within a right
  33. // aligned nav component. To enable the undoing of that, we provide an override
  34. // to restore the default dropdown menu alignment.
  35. //
  36. // This is only for left-aligning a dropdown menu within a `.navbar-right` or
  37. // `.pull-right` nav component.
  38. .dropdown-menu-left {
  39. left: 0;
  40. right: auto;
  41. }
  42. // Component alignment
  43. //
  44. // Reiterate per navbar.less and the modified component alignment there.
  45. @media (min-width: @grid-float-breakpoint) {
  46. .navbar-right {
  47. .dropdown-menu {
  48. .dropdown-menu-right();
  49. }
  50. // Necessary for overrides of the default right aligned menu.
  51. // Will remove come v4 in all likelihood.
  52. .dropdown-menu-left {
  53. .dropdown-menu-left();
  54. }
  55. }
  56. }