user-dropdown-position.less 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. .enable_navbar_dropdown_positions() when(@enable-navbar-dropdowns = true) {
  2. @media only screen and (max-width: @screen-xs-max) {
  3. .ace-nav > li:nth-last-child(4) > .dropdown-menu.dropdown-menu-right {
  4. right: -100px;
  5. &:before, &:after {
  6. right: 120px;
  7. }
  8. }
  9. .ace-nav > li:nth-last-child(3) > .dropdown-menu.dropdown-menu-right {
  10. right: -80px;
  11. &:before, &:after {
  12. right: 100px;
  13. }
  14. }
  15. .user-menu.dropdown-close.dropdown-menu-right {
  16. right: 0 !important;
  17. }
  18. }
  19. @media only screen and (min-width: @screen-topbar-down-min) and (max-width: @screen-xs-max) {
  20. //if there's only one item except for user_info
  21. .navbar.navbar-collapse {
  22. .ace-nav > li:nth-last-child(2):nth-child(1) > .dropdown-menu.dropdown-menu-right,
  23. .ace-nav > li:nth-last-child(2):nth-child(2) > .dropdown-menu.dropdown-menu-right {
  24. left: auto;
  25. right: -60px;
  26. &:before, &:after {
  27. right: 80px;
  28. left: auto;
  29. }
  30. }
  31. }
  32. }
  33. @media only screen and (max-width: @screen-xs) {
  34. .ace-nav > li:nth-last-child(4) > .dropdown-menu.dropdown-menu-right {
  35. right: -120px;
  36. &:before, &:after {
  37. right: 140px;
  38. }
  39. }
  40. .ace-nav > li:nth-last-child(3) > .dropdown-menu.dropdown-menu-right {
  41. right: -90px;
  42. &:before, &:after {
  43. right: 110px;
  44. }
  45. }
  46. .ace-nav > li:nth-last-child(2) > .dropdown-menu.dropdown-menu-right {
  47. right: -50px;
  48. &:before, &:after {
  49. right: 70px;
  50. }
  51. }
  52. }
  53. @media only screen and (max-width: @screen-topbar-down) {
  54. .ace-nav > li:nth-last-child(4) > .dropdown-menu.dropdown-menu-right {
  55. left: -10px;
  56. right: auto;
  57. &:before, &:after {
  58. right: auto;
  59. left: 30px;
  60. }
  61. }
  62. .ace-nav > li:nth-last-child(3) > .dropdown-menu.dropdown-menu-right {
  63. left: -50px;
  64. right: auto;
  65. &:before, &:after {
  66. left: 75px;
  67. right: auto;
  68. }
  69. }
  70. .ace-nav > li:nth-last-child(2) > .dropdown-menu.dropdown-menu-right {
  71. left: -70px;
  72. right: auto;
  73. &:before, &:after {
  74. left: 90px;
  75. right: auto;
  76. }
  77. }
  78. }
  79. @media only screen and (max-width: @screen-mini-max) {
  80. //when there are only two items (apart from user menu)
  81. .ace-nav > li:nth-last-child(2) > .dropdown-menu.dropdown-menu-right {
  82. left: -110px;
  83. right: auto;
  84. &:before, &:after {
  85. left: 130px;
  86. right: auto;
  87. }
  88. }
  89. .ace-nav > li:nth-child(2):nth-last-child(2) > .dropdown-menu.dropdown-menu-right {
  90. left: -85px;
  91. right: auto;
  92. &:before, &:after {
  93. left: 105px;
  94. right: auto;
  95. }
  96. }
  97. .ace-nav > li:nth-child(1):nth-last-child(3) > .dropdown-menu.dropdown-menu-right {
  98. left: -35px;
  99. right: auto;
  100. &:before, &:after {
  101. left: 55px;
  102. right: auto;
  103. }
  104. }
  105. //when there is only one item (apart from user menu)
  106. .ace-nav > li:nth-child(1):nth-last-child(2) > .dropdown-menu.dropdown-menu-right {
  107. left: -60px;
  108. right: auto;
  109. &:before, &:after {
  110. left: 75px;
  111. right: auto;
  112. }
  113. }
  114. }
  115. }
  116. .enable_navbar_dropdown_positions();