1ead1c50a46566ed03eae2a4a92b3f045d3832bcd9304b3ca2875156d4009b26309b94e9217835fbdbdaef2e17390917c20380f72de5a56253e3957cf5d88d 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. @import "mixins/mixins";
  2. @import "mixins/utils";
  3. @import "common/var";
  4. @import "common/transition";
  5. @mixin menu-item {
  6. height: 56px;
  7. line-height: 56px;
  8. font-size: $--menu-item-font-size;
  9. color: $--menu-item-font-color;
  10. padding: 0 20px;
  11. list-style: none;
  12. cursor: pointer;
  13. position: relative;
  14. transition: border-color .3s, background-color .3s, color .3s;
  15. box-sizing: border-box;
  16. white-space: nowrap;
  17. * {
  18. vertical-align: middle;
  19. }
  20. i {
  21. color: $--color-text-secondary;
  22. }
  23. &:hover,
  24. &:focus {
  25. outline: none;
  26. background-color: $--menu-item-hover-fill;
  27. }
  28. @include when(disabled) {
  29. opacity: 0.25;
  30. cursor: not-allowed;
  31. background: none !important;
  32. }
  33. }
  34. @include b(menu) {
  35. border-right: solid 1px #e6e6e6;
  36. list-style: none;
  37. position: relative;
  38. margin: 0;
  39. padding-left: 0;
  40. background-color: $--menu-background-color;
  41. @include utils-clearfix;
  42. &.el-menu--horizontal {
  43. border-bottom: solid 1px #e6e6e6;
  44. }
  45. @include m(horizontal) {
  46. border-right: none;
  47. & > .el-menu-item {
  48. float: left;
  49. height: 60px;
  50. line-height: 60px;
  51. margin: 0;
  52. border-bottom: 2px solid transparent;
  53. color: $--color-text-secondary;
  54. a,
  55. a:hover {
  56. color: inherit;
  57. }
  58. &:not(.is-disabled):hover,
  59. &:not(.is-disabled):focus{
  60. background-color: #fff;
  61. }
  62. }
  63. & > .el-submenu {
  64. float: left;
  65. &:focus,
  66. &:hover {
  67. outline: none;
  68. .el-submenu__title {
  69. color: $--color-text-primary;
  70. }
  71. }
  72. &.is-active {
  73. .el-submenu__title {
  74. border-bottom: 2px solid $--color-primary;
  75. color: $--color-text-primary;
  76. }
  77. }
  78. & .el-submenu__title {
  79. height: 60px;
  80. line-height: 60px;
  81. border-bottom: 2px solid transparent;
  82. color: $--color-text-secondary;
  83. &:hover {
  84. background-color: #fff;
  85. }
  86. }
  87. & .el-submenu__icon-arrow {
  88. position: static;
  89. vertical-align: middle;
  90. margin-left: 8px;
  91. margin-top: -3px;
  92. }
  93. }
  94. & .el-menu {
  95. & .el-menu-item,
  96. & .el-submenu__title {
  97. background-color: $--color-white;
  98. float: none;
  99. height: 36px;
  100. line-height: 36px;
  101. padding: 0 10px;
  102. color: $--color-text-secondary;
  103. }
  104. & .el-menu-item.is-active,
  105. & .el-submenu.is-active > .el-submenu__title {
  106. color: $--color-text-primary;
  107. }
  108. }
  109. & .el-menu-item:not(.is-disabled):hover,
  110. & .el-menu-item:not(.is-disabled):focus {
  111. outline: none;
  112. color: $--color-text-primary;
  113. }
  114. & > .el-menu-item.is-active {
  115. border-bottom: 2px solid $--color-primary;
  116. color: $--color-text-primary;
  117. }
  118. }
  119. @include m(collapse) {
  120. width: 64px;
  121. > .el-menu-item,
  122. > .el-submenu > .el-submenu__title {
  123. [class^="el-icon-"] {
  124. margin: 0;
  125. vertical-align: middle;
  126. width: 24px;
  127. text-align: center;
  128. }
  129. .el-submenu__icon-arrow {
  130. display: none;
  131. }
  132. span {
  133. height: 0;
  134. width: 0;
  135. overflow: hidden;
  136. visibility: hidden;
  137. display: inline-block;
  138. }
  139. }
  140. > .el-menu-item.is-active i {
  141. color: inherit;
  142. }
  143. .el-menu .el-submenu {
  144. min-width: 200px;
  145. }
  146. .el-submenu {
  147. position: relative;
  148. & .el-menu {
  149. position: absolute;
  150. margin-left: 5px;
  151. top: 0;
  152. left: 100%;
  153. z-index: 10;
  154. border: 1px solid $--border-color-light;
  155. border-radius: $--border-radius-small;
  156. box-shadow: $--box-shadow-light;
  157. }
  158. &.is-opened {
  159. > .el-submenu__title .el-submenu__icon-arrow {
  160. transform: none;
  161. }
  162. }
  163. }
  164. }
  165. @include m(popup) {
  166. z-index: 100;
  167. min-width: 200px;
  168. border: none;
  169. padding: 5px 0;
  170. border-radius: $--border-radius-small;
  171. box-shadow: $--box-shadow-light;
  172. &-bottom-start {
  173. margin-top: 5px;
  174. }
  175. &-right-start {
  176. margin-left: 5px;
  177. margin-right: 5px;
  178. }
  179. }
  180. }
  181. @include b(menu-item) {
  182. @include menu-item;
  183. & [class^="el-icon-"] {
  184. margin-right: 5px;
  185. width: 24px;
  186. text-align: center;
  187. font-size: 18px;
  188. vertical-align: middle;
  189. }
  190. @include when(active) {
  191. color: $--color-primary;
  192. i {
  193. color: inherit;
  194. }
  195. }
  196. }
  197. @include b(submenu) {
  198. list-style: none;
  199. margin: 0;
  200. padding-left: 0;
  201. @include e(title) {
  202. @include menu-item;
  203. &:hover {
  204. background-color: $--menu-item-hover-fill;
  205. }
  206. }
  207. & .el-menu {
  208. border: none;
  209. }
  210. & .el-menu-item {
  211. height: 50px;
  212. line-height: 50px;
  213. padding: 0 45px;
  214. min-width: 200px;
  215. }
  216. @include e(icon-arrow) {
  217. position: absolute;
  218. top: 50%;
  219. right: 20px;
  220. margin-top: -7px;
  221. transition: transform .3s;
  222. font-size: 12px;
  223. }
  224. @include when(active) {
  225. .el-submenu__title {
  226. border-bottom-color: $--color-primary;
  227. }
  228. }
  229. @include when(opened) {
  230. > .el-submenu__title .el-submenu__icon-arrow {
  231. transform: rotateZ(180deg);
  232. }
  233. }
  234. @include when(disabled) {
  235. .el-submenu__title,
  236. .el-menu-item {
  237. opacity: 0.25;
  238. cursor: not-allowed;
  239. background: none !important;
  240. }
  241. }
  242. [class^="el-icon-"] {
  243. vertical-align: middle;
  244. margin-right: 5px;
  245. width: 24px;
  246. text-align: center;
  247. font-size: 18px;
  248. }
  249. }
  250. @include b(menu-item-group) {
  251. > ul {
  252. padding: 0;
  253. }
  254. @include e(title) {
  255. padding: 7px 0 7px 20px;
  256. line-height: normal;
  257. font-size: 12px;
  258. color: $--color-text-secondary;
  259. }
  260. }
  261. .horizontal-collapse-transition .el-submenu__title .el-submenu__icon-arrow {
  262. transition: .2s;
  263. opacity: 0;
  264. }