menu.less 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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. margin-bottom: 4px;
  71. }
  72. > li.down {
  73. position: relative;
  74. > a:after {
  75. content: "\25B8";
  76. position: absolute;
  77. right: .6em;
  78. }
  79. }
  80. > li.hover {
  81. position: relative;
  82. > a:after {
  83. content: "\25B8";
  84. position: absolute;
  85. left: .5em;
  86. }
  87. }
  88. }
  89. ul.menu-border,
  90. ul.menu-down {
  91. border: 1px solid @menuBorderColor;
  92. > li.head {
  93. border-bottom: 1px solid @menuBorderColor;
  94. }
  95. }
  96. ul {
  97. &.menu-down {
  98. position: absolute;
  99. display: none;
  100. z-index: 99;
  101. box-shadow: 0 0 2px @menuShadowColor;
  102. background-color: @menuDownBgColor;
  103. }
  104. &.menu-down-show {
  105. position: absolute;
  106. z-index: 99;
  107. box-shadow: 0 0 2px @menuShadowColor;
  108. background-color: @menuDownBgColor;
  109. }
  110. }
  111. ul.menu-radius {
  112. border-radius: .3em;
  113. > li {
  114. &:first-child {
  115. border-top-left-radius: .3em;
  116. border-top-right-radius: .3em;
  117. > a {
  118. border-top-left-radius: .2em;
  119. border-top-right-radius: .2em;
  120. }
  121. }
  122. &:last-child {
  123. border-bottom-left-radius: .3em;
  124. border-bottom-right-radius: .3em;
  125. > a {
  126. border-bottom-left-radius: .2em;
  127. border-bottom-right-radius: .2em;
  128. }
  129. }
  130. }
  131. }
  132. .drop {
  133. position: relative;
  134. &:hover {
  135. > .drop-down {
  136. position: absolute;
  137. top: 0;
  138. left: 0;
  139. width: 200%;
  140. display: block;
  141. }
  142. }
  143. > .drop-down {
  144. display: none;
  145. border: 1px solid @dropBorderColor;
  146. box-shadow: 0 0 3px @menuShadowColor;
  147. background-color: @dropDownBgColor;
  148. }
  149. }
  150. .drop-bottom {
  151. &:after {
  152. content: "\25BE";
  153. margin-left: .4em;
  154. }
  155. }
  156. .drop-top {
  157. &:after {
  158. content: "\25B4";
  159. margin-left: .4em;
  160. }
  161. }