dropdowns.less 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. //
  2. // Dropdown menus
  3. // --------------------------------------------------
  4. /* All Displays */
  5. .dropdown-menu {
  6. border: none;
  7. border-radius: @border-radius-base !important;
  8. box-shadow: 0px 0px 0px 6px @dropdown-shadow;
  9. margin-top: 12px;
  10. max-height: 310px;
  11. &:after {
  12. border: solid transparent;
  13. border-bottom-color: @dropdown-bg;
  14. border-width: 6px;
  15. content: "";
  16. height: 0;
  17. position: absolute;
  18. pointer-events: none;
  19. left: 12px;
  20. top: -11px;
  21. width: 0;
  22. }
  23. li {
  24. /* Links */
  25. a {
  26. padding: @padding-base-vertical @padding-large-horizontal;
  27. }
  28. /* Buttons */
  29. button {
  30. background: none;
  31. border: none;
  32. border-radius: 0px;
  33. padding: @padding-base-vertical @padding-large-horizontal;
  34. width: 100%;
  35. color: @dropdown-link-color;
  36. text-align: left;
  37. white-space: nowrap;
  38. }
  39. /* Colors */
  40. a, button {
  41. &:hover {
  42. background-color: @dropdown-link-hover-bg;
  43. transition-timing-function: ease;
  44. transition-duration: 0.15s;
  45. color: @dropdown-link-hover-color;
  46. }
  47. &:active, &:focus {
  48. background-color: @dropdown-link-active-bg;
  49. outline: none;
  50. transition-duration: 0.07s;
  51. color: @dropdown-link-active-color;
  52. }
  53. }
  54. /* Icons */
  55. a, button {
  56. .glyphicon, .fa {
  57. display: inline-block;
  58. margin-right: 4px;
  59. width: 16px;
  60. text-align: center;
  61. }
  62. }
  63. /* Badges */
  64. a {
  65. .badge {
  66. border-radius: @border-radius-small;
  67. position: relative;
  68. top: 1px;
  69. }
  70. &:link, &:visited {
  71. .badge {
  72. background-color: @brand-danger;
  73. color: @dropdown-bg;
  74. }
  75. }
  76. &:hover {
  77. .badge {
  78. background-color: @dropdown-bg;
  79. color: @dropdown-link-hover-bg;
  80. }
  81. }
  82. &:active {
  83. .badge {
  84. background-color: @dropdown-bg;
  85. color: @dropdown-link-active-bg;
  86. }
  87. }
  88. }
  89. }
  90. }
  91. /* Move arrow to right on pull-right dropdowns */
  92. .pull-right {
  93. .dropdown-menu:after {
  94. left: auto;
  95. right: 12px;
  96. }
  97. }
  98. /* Big displays */
  99. @media (min-width: @screen-sm-min) {
  100. .dropdown-menu {
  101. &.width-medium {
  102. max-width: 200px;
  103. }
  104. &.width-large {
  105. max-width: 300px;
  106. }
  107. .dropdown-title {
  108. background-color: @dropdown-title-bg;
  109. border-bottom: 1px solid @dropdown-title-border;
  110. border-radius: @border-radius-base @border-radius-base 0px 0px;
  111. margin-top: -5px;
  112. margin-bottom: 5px;
  113. padding: @padding-base-vertical @padding-base-horizontal;
  114. color: @dropdown-title-color;
  115. font-weight: bold;
  116. .badge {
  117. background-color: darken(@brand-danger, 10%);
  118. border-radius: @border-radius-small;
  119. }
  120. }
  121. .dropdown-footer {
  122. background-color: @dropdown-title-bg;
  123. border-top: 1px solid @dropdown-title-border;
  124. .box-shadow(0px -3px 3px -1px darken(@dropdown-title-bg, 5%));
  125. border-radius: 0px 0px @border-radius-base @border-radius-base;
  126. margin-bottom: -5px;
  127. padding: @padding-base-vertical @padding-base-horizontal;
  128. color: @dropdown-title-color;
  129. font-weight: bold;
  130. }
  131. &>li {
  132. .badge {
  133. margin-left: @line-height-computed / 2;
  134. }
  135. button {
  136. background: none;
  137. border: none;
  138. width: 100%;
  139. color: @dropdown-link-color;
  140. text-align: left;
  141. &:hover {
  142. background-color: @dropdown-link-hover-bg;
  143. color: @dropdown-link-hover-color;
  144. }
  145. &:active, &:focus {
  146. background-color: @dropdown-link-active-bg;
  147. color: @dropdown-link-active-color;
  148. }
  149. }
  150. }
  151. }
  152. }
  153. // Dropup tweak
  154. .dropup {
  155. .dropdown-menu {
  156. margin-top: 0px;
  157. margin-bottom: 8px;
  158. }
  159. }
  160. // Utility class for js scroll handling
  161. .scrollable {
  162. overflow-y: auto;
  163. }