menu.less 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. @import "var";
  2. // lined menu
  3. ul.menu {
  4. > li {
  5. list-style: none;
  6. > a {
  7. padding: .8em 1.2em;
  8. &:hover {
  9. background-color: @lineMenuHoverBgColor;
  10. color: @lineMenuHoverFontColor;
  11. }
  12. &.active {
  13. background-color: #4183c4;
  14. color: #FFF;
  15. }
  16. }
  17. &.current > a,
  18. &.hover > a {
  19. color: @lineMenuHoverFontColor;
  20. }
  21. }
  22. > li.head {
  23. font-weight: bold;
  24. padding: .8em 1.2em;
  25. }
  26. > li.down:hover {
  27. > ul.menu-down {
  28. display: block;
  29. }
  30. }
  31. > li.border-bottom {
  32. border-bottom: 1px solid @menuBorderColor;
  33. height: 0;
  34. margin: .5em 0;
  35. }
  36. }
  37. ul.menu-line {
  38. > li,
  39. > li > a {
  40. display: inline-block;
  41. }
  42. > li.down {
  43. position: relative;
  44. > a:after {
  45. content: "\25BE";
  46. margin-left: .4em;
  47. }
  48. > ul.menu-down {
  49. top: 2.1em;
  50. width: 150%;
  51. }
  52. }
  53. > li.hover {
  54. position: relative;
  55. > a:after {
  56. position: absolute;
  57. content: "\25B4";
  58. left: 50%;
  59. bottom: -1.1em;
  60. margin-left: -4px;
  61. }
  62. }
  63. }
  64. ul.menu-vertical,
  65. ul.menu-down {
  66. > li > a,
  67. > li.head {
  68. display: block;
  69. padding: .4em 1.2em;
  70. }
  71. > li.down {
  72. position: relative;
  73. > a:after {
  74. content: "\25B8";
  75. position: absolute;
  76. right: .6em;
  77. }
  78. }
  79. > li.hover {
  80. position: relative;
  81. > a:after {
  82. content: "\25B8";
  83. position: absolute;
  84. left: .5em;
  85. }
  86. }
  87. }
  88. ul.menu-border,
  89. ul.menu-down {
  90. border: 1px solid @menuBorderColor;
  91. > li.head {
  92. border-bottom: 1px solid @menuBorderColor;
  93. }
  94. }
  95. ul {
  96. &.menu-down {
  97. position: absolute;
  98. display: none;
  99. z-index: 99;
  100. box-shadow: 0 0 2px @menuShadowColor;
  101. background-color: @menuDownBgColor;
  102. }
  103. &.menu-down-show {
  104. position: absolute;
  105. z-index: 99;
  106. box-shadow: 0 0 2px @menuShadowColor;
  107. background-color: @menuDownBgColor;
  108. }
  109. }
  110. ul.menu-radius {
  111. border-radius: .3em;
  112. > li {
  113. &:first-child {
  114. border-top-left-radius: .3em;
  115. border-top-right-radius: .3em;
  116. > a {
  117. border-top-left-radius: .2em;
  118. border-top-right-radius: .2em;
  119. }
  120. }
  121. &:last-child {
  122. border-bottom-left-radius: .3em;
  123. border-bottom-right-radius: .3em;
  124. > a {
  125. border-bottom-left-radius: .2em;
  126. border-bottom-right-radius: .2em;
  127. }
  128. }
  129. }
  130. }
  131. .drop {
  132. position: relative;
  133. &:hover {
  134. > .drop-down {
  135. position: absolute;
  136. top: 0;
  137. left: 0;
  138. width: 200%;
  139. display: block;
  140. }
  141. }
  142. > .drop-down {
  143. display: none;
  144. border: 1px solid @dropBorderColor;
  145. box-shadow: 0 0 3px @menuShadowColor;
  146. background-color: @dropDownBgColor;
  147. }
  148. }
  149. .drop-bottom {
  150. &:after {
  151. content: "\25BE";
  152. margin-left: .4em;
  153. }
  154. }
  155. .drop-top {
  156. &:after {
  157. content: "\25B4";
  158. margin-left: .4em;
  159. }
  160. }