dropdowns.less 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. //
  2. // Dropdowns
  3. // --------------------------------------------------
  4. // Unify .btn-link appearance with anchors
  5. .dropdown-menu>li>a,
  6. .dropdown-menu>li>.btn-link,
  7. .modal-menu>li>a,
  8. .modal-menu>li>.btn-link {
  9. display: block;
  10. border: none;
  11. clear: both;
  12. float: none;
  13. padding: 6px 20px;
  14. width: 100%;
  15. color: @dropdown-link-color;
  16. font-weight: normal;
  17. line-height: @line-height-base;
  18. text-align: left;
  19. white-space: nowrap;
  20. &:hover, &:focus {
  21. background-color: @dropdown-link-hover-bg;
  22. color: @dropdown-link-hover-color;
  23. text-decoration: none;
  24. }
  25. &:active {
  26. background-color: @dropdown-link-hover-bg;
  27. color: @dropdown-link-hover-color;
  28. text-decoration: none;
  29. }
  30. // Set material icons in dropdown menus
  31. .material-icon {
  32. margin: -2px 0px;
  33. margin-right: @line-height-computed * .35;
  34. position: relative;
  35. bottom: 1px;
  36. font-size: 18px;
  37. }
  38. .badge {
  39. float: right;
  40. position: relative;
  41. top: 1px;
  42. }
  43. }
  44. // Extra overrides for modal nav
  45. .modal-menu {
  46. margin: @line-height-computed 0px;
  47. padding: 0px;
  48. }
  49. .modal-menu>li {
  50. margin: @line-height-computed / 3 0px;
  51. padding: 0px;
  52. list-style: none;
  53. }
  54. // Bump min dropdown width to 210px
  55. .dropdown-menu {
  56. width: 210px;
  57. }
  58. // Dropdown footer
  59. .dropdown-menu .dropdown-footer {
  60. padding: 6px 20px;
  61. }
  62. // Dropdown buttons container
  63. .dropdown-menu .dropdown-buttons {
  64. padding: 2px 20px;
  65. padding-bottom: 7px;
  66. .btn {
  67. margin: 4px 0px;
  68. }
  69. }
  70. // Always displayed on mobile dropdown
  71. .mobile-dropdown, .compact-nav {
  72. position: static;
  73. margin: 0px;
  74. overflow: auto;
  75. &.open {
  76. margin-bottom: @line-height-computed;
  77. }
  78. }
  79. .compact-nav.open {
  80. margin-top: @line-height-computed * -1;
  81. }
  82. .mobile-dropdown.open>.dropdown-menu, .compact-nav.open>.dropdown-menu {
  83. border: none;
  84. border-radius: 0;
  85. .box-shadow(none);
  86. display: block;
  87. margin: 0px;
  88. width: 100%;
  89. position: static;
  90. }
  91. // Guest menu
  92. .user-dropdown .guest-preview {
  93. text-align: center;
  94. .row {
  95. margin: 0px;
  96. }
  97. }
  98. // User menu
  99. .navbar .user-dropdown {
  100. width: 240px;
  101. }
  102. .user-dropdown .dropdown-header {
  103. padding: 6px 20px;
  104. font-size: @font-size-large;
  105. strong {
  106. font-weight: normal;
  107. }
  108. }
  109. // Category picker
  110. .category-picker .dropdown-menu {
  111. // Make category picker wider on desktops
  112. @media screen and (min-width: @screen-md-min) {
  113. width: 300px;
  114. }
  115. }
  116. .category-picker .dropdown-menu>li>.btn-link {
  117. white-space: normal;
  118. word-wrap: break-word;
  119. }
  120. // Stick to bottom on mobile
  121. @media screen and (max-width: @screen-xs-max) {
  122. .dropdown-menu.stick-to-bottom {
  123. border-radius: 0px;
  124. border: none;
  125. max-height: 300px;
  126. overflow-y: auto;
  127. .box-shadow(0px 0px @line-height-computed * 1.5 @gray-light);
  128. clear: both;
  129. top: auto;
  130. width: 100%;
  131. position: fixed;
  132. bottom: 0px;
  133. margin: 0px;
  134. padding: 0px;
  135. padding-bottom: @line-height-computed;
  136. li {
  137. float: none;
  138. margin: 0px;
  139. clear: both;
  140. &>a, &>.btn {
  141. padding-top: @line-height-computed * 0.75;
  142. padding-bottom: @line-height-computed * 0.75;
  143. border-bottom: 1px solid @dropdown-divider-bg;
  144. }
  145. }
  146. }
  147. }