menu.scss 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. // 水平样式
  2. .m-menu--horizontal{
  3. height: 60px;
  4. line-height: 60px;
  5. border-bottom: 1px solid #e6e6e6;
  6. .m-menu-item,
  7. .m-submenu{
  8. float: left;
  9. height: inherit;
  10. line-height: inherit;
  11. box-sizing: border-box;
  12. padding: 0 20px;
  13. font-size: 14px;
  14. cursor: pointer;
  15. transition: all .2s ease-in-out;
  16. }
  17. .m-menu-item{
  18. &:hover{
  19. color: #409eff;
  20. }
  21. }
  22. .m-submenu{
  23. color: #303133;
  24. position: relative;
  25. .m-submenu-title{
  26. &:hover{
  27. color: #409eff;
  28. }
  29. .iconfont{
  30. margin-left: 5px;
  31. }
  32. }
  33. .m-select-dropdown{
  34. position: absolute;
  35. left: 0;
  36. top: 61px;
  37. min-width: 200px;
  38. background: #fff;
  39. border: 1px solid #dcdfe6f6;
  40. border-radius: 4px;
  41. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  42. z-index: 999;
  43. .m-menu-item{
  44. float:none;
  45. color: #515a6e;
  46. text-align: left;
  47. height: 40px;
  48. line-height: 40px;
  49. &:hover{
  50. color: #409eff;
  51. background-color: #ECF5FF;
  52. }
  53. &.is-active{
  54. color: #409eff;
  55. border-bottom: none;
  56. }
  57. }
  58. .m-submenu{
  59. float: none;
  60. height: 40px;
  61. line-height: 40px;
  62. .iconfont{
  63. position: absolute;
  64. top: 0;
  65. right: 24px;
  66. }
  67. }
  68. .m-menu-group{
  69. .m-menu-group-title{
  70. padding: 7px 0 7px 10px;
  71. line-height: normal;
  72. font-size: 12px;
  73. color: #909399;
  74. }
  75. }
  76. }
  77. }
  78. .is-active{
  79. color: #2d8cf0;
  80. border-bottom: 2px solid #2d8cf0;
  81. }
  82. }
  83. // 垂直样式
  84. .m-menu--vertical{
  85. display: inline-block;
  86. vertical-align: top;
  87. text-align: left;
  88. width: 240px;
  89. min-height: 400px;
  90. border-right: 1px solid #e6e6e6;
  91. .m-menu-item,
  92. .m-submenu{
  93. font-size: 14px;
  94. color: #303133;
  95. list-style: none;
  96. cursor: pointer;
  97. }
  98. .m-menu-item{
  99. height: 56px;
  100. line-height: 56px;
  101. padding: 0 20px;
  102. &:hover{
  103. color: #409eff;
  104. background-color: #ECF5FF;
  105. }
  106. }
  107. .m-submenu{
  108. padding: 0;
  109. .m-submenu-title{
  110. height: 56px;
  111. line-height: 56px;
  112. padding: 0 20px;
  113. position: relative;
  114. &:hover{
  115. color: #409eff;
  116. background-color: #ECF5FF;
  117. }
  118. .iconfont{
  119. position: absolute;
  120. top: 0;
  121. right: 24px;
  122. }
  123. }
  124. .m-select-dropdown{
  125. .m-menu-item{
  126. padding: 0 20px 0 40px;
  127. }
  128. }
  129. }
  130. .m-menu-group{
  131. .m-menu-group-title{
  132. padding: 7px 0 7px 20px;
  133. line-height: normal;
  134. font-size: 12px;
  135. color: #909399;
  136. }
  137. }
  138. .is-active {
  139. color: #2d8cf0;
  140. }
  141. }
  142. // 黑色主题
  143. .m-menu--dark{
  144. background: #515a6e;
  145. color: #fff;
  146. .m-menu-item{
  147. color: #fff;
  148. &.is-active{
  149. color: #fff;
  150. background: #2d8cf0;
  151. }
  152. }
  153. .m-submenu{
  154. .m-submenu-title{
  155. color: #fff;
  156. }
  157. .m-select-dropdown{
  158. background: #515a6e;
  159. .m-menu-item{
  160. color: #fff;
  161. &:hover{
  162. color: #409eff;
  163. }
  164. &.is-active{
  165. color: #fff;
  166. background: #2d8cf0;
  167. }
  168. }
  169. }
  170. }
  171. }
  172. .m-menu--horizontal.m-menu--dark{
  173. .m-menu-item{
  174. &.is-active{
  175. color: #2d8cf0;
  176. background: transparent;
  177. }
  178. }
  179. .m-submenu{
  180. &.is-active{
  181. .m-submenu-title{
  182. color: #2d8cf0;
  183. }
  184. }
  185. }
  186. }
  187. .m-menu--vertical.m-menu--dark{
  188. .m-submenu{
  189. &.is-active{
  190. .m-submenu-title{
  191. color: #2d8cf0;
  192. }
  193. }
  194. }
  195. }
  196. // 禁用
  197. .m-menu-item.is-disabled,
  198. .m-submenu .m-menu-item.is-disabled{
  199. cursor: not-allowed;
  200. color: #cacaca !important;
  201. background: none !important;
  202. &:hover{
  203. color: #cacaca !important;
  204. }
  205. }
  206. .m-menu--dark .m-menu-item.is-disabled{
  207. cursor: not-allowed;
  208. opacity: .3;
  209. color: #cacaca !important;
  210. background: none !important;
  211. &:hover{
  212. color: #cacaca !important;
  213. }
  214. }