dropdowns.less.svn-base 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. // DROPDOWN MENUS
  2. // --------------
  3. // Use the .menu class on any <li> element within the topbar or ul.tabs and you'll get some superfancy dropdowns
  4. .dropup,
  5. .dropdown {
  6. position: relative;
  7. }
  8. .dropdown-toggle {
  9. // The caret makes the toggle a bit too tall in IE7
  10. *margin-bottom: -3px;
  11. }
  12. .dropdown-toggle:active,
  13. .open .dropdown-toggle {
  14. outline: 0;
  15. }
  16. // Dropdown arrow/caret
  17. // --------------------
  18. .caret {
  19. display: inline-block;
  20. width: 0;
  21. height: 0;
  22. vertical-align: top;
  23. border-top: 4px solid @black;
  24. border-right: 4px solid transparent;
  25. border-left: 4px solid transparent;
  26. content: "";
  27. .opacity(30);
  28. }
  29. // Place the caret
  30. .dropdown .caret {
  31. margin-top: 8px;
  32. margin-left: 2px;
  33. }
  34. .dropdown:hover .caret,
  35. .open .caret {
  36. .opacity(100);
  37. }
  38. // The dropdown menu (ul)
  39. // ----------------------
  40. .dropdown-menu {
  41. position: absolute;
  42. top: 100%;
  43. left: 0;
  44. z-index: @zindexDropdown;
  45. display: none; // none by default, but block on "open" of the menu
  46. float: left;
  47. min-width: 160px;
  48. padding: 4px 0;
  49. margin: 1px 0 0; // override default ul
  50. list-style: none;
  51. background-color: @dropdownBackground;
  52. border: 1px solid #ccc;
  53. border: 1px solid rgba(0,0,0,.2);
  54. *border-right-width: 2px;
  55. *border-bottom-width: 2px;
  56. .border-radius(5px);
  57. .box-shadow(0 5px 10px rgba(0,0,0,.2));
  58. -webkit-background-clip: padding-box;
  59. -moz-background-clip: padding;
  60. background-clip: padding-box;
  61. // Aligns the dropdown menu to right
  62. &.pull-right {
  63. right: 0;
  64. left: auto;
  65. }
  66. // Dividers (basically an hr) within the dropdown
  67. .divider {
  68. .nav-divider();
  69. }
  70. // Links within the dropdown menu
  71. a {
  72. display: block;
  73. padding: 3px 15px;
  74. clear: both;
  75. font-weight: normal;
  76. line-height: @baseLineHeight;
  77. color: @dropdownLinkColor;
  78. white-space: nowrap;
  79. }
  80. }
  81. // Hover state
  82. // -----------
  83. .dropdown-menu li > a:hover,
  84. .dropdown-menu .active > a,
  85. .dropdown-menu .active > a:hover {
  86. color: @dropdownLinkColorHover;
  87. text-decoration: none;
  88. background-color: @dropdownLinkBackgroundHover;
  89. }
  90. // Open state for the dropdown
  91. // ---------------------------
  92. .open {
  93. // IE7's z-index only goes to the nearest positioned ancestor, which would
  94. // make the menu appear below buttons that appeared later on the page
  95. *z-index: @zindexDropdown;
  96. .dropdown-menu {
  97. display: block;
  98. }
  99. }
  100. // Right aligned dropdowns
  101. // ---------------------------
  102. .pull-right .dropdown-menu {
  103. right: 0;
  104. left: auto;
  105. }
  106. // Allow for dropdowns to go bottom up (aka, dropup-menu)
  107. // ------------------------------------------------------
  108. // Just add .dropup after the standard .dropdown class and you're set, bro.
  109. // TODO: abstract this so that the navbar fixed styles are not placed here?
  110. .dropup,
  111. .navbar-fixed-bottom .dropdown {
  112. // Reverse the caret
  113. .caret {
  114. border-top: 0;
  115. border-bottom: 4px solid @black;
  116. content: "\2191";
  117. }
  118. // Different positioning for bottom up menu
  119. .dropdown-menu {
  120. top: auto;
  121. bottom: 100%;
  122. margin-bottom: 1px;
  123. }
  124. }
  125. // Typeahead
  126. // ---------
  127. .typeahead {
  128. margin-top: 2px; // give it some space to breathe
  129. .border-radius(4px);
  130. }