index.less 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  1. @menuPrefixCls: rc-menu;
  2. @font-face {
  3. font-family: 'FontAwesome';
  4. src: url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/fonts/fontawesome-webfont.eot');
  5. src: url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/fonts/fontawesome-webfont.eot?#iefix')
  6. format('embedded-opentype'),
  7. url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/fonts/fontawesome-webfont.woff')
  8. format('woff'),
  9. url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/fonts/fontawesome-webfont.ttf')
  10. format('truetype'),
  11. url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/fonts/fontawesome-webfont.svg?#fontawesomeregular')
  12. format('svg');
  13. font-weight: normal;
  14. font-style: normal;
  15. }
  16. .@{menuPrefixCls} {
  17. outline: none;
  18. margin-bottom: 0;
  19. padding-left: 0; // Override default ul/ol
  20. padding-right: 0; // Override default ul/ol in RTL direction
  21. list-style: none;
  22. border: 1px solid #d9d9d9;
  23. box-shadow: 0 0 4px #d9d9d9;
  24. border-radius: 3px;
  25. color: #666;
  26. &-rtl {
  27. direction: rtl;
  28. }
  29. &-hidden,
  30. &-submenu-hidden {
  31. display: none;
  32. }
  33. &-collapse {
  34. overflow: hidden;
  35. // &-active {
  36. transition: height 0.3s ease-out;
  37. // }
  38. }
  39. &-item-group-list {
  40. margin: 0;
  41. padding: 0;
  42. }
  43. &-item-group-title {
  44. color: #999;
  45. line-height: 1.5;
  46. padding: 8px 10px;
  47. border-bottom: 1px solid #dedede;
  48. }
  49. &-item-active,
  50. &-submenu-active > &-submenu-title {
  51. background-color: #eaf8fe;
  52. }
  53. &-item-selected {
  54. background-color: #eaf8fe;
  55. // fix chrome render bug
  56. transform: translateZ(0);
  57. }
  58. &-submenu-selected {
  59. background-color: #eaf8fe;
  60. }
  61. & > li&-submenu {
  62. padding: 0;
  63. }
  64. &-horizontal&-sub,
  65. &-vertical&-sub,
  66. &-vertical-left&-sub,
  67. &-vertical-right&-sub {
  68. min-width: 160px;
  69. margin-top: 0;
  70. }
  71. &-item,
  72. &-submenu-title {
  73. margin: 0;
  74. position: relative;
  75. display: block;
  76. padding: 7px 7px 7px 16px;
  77. white-space: nowrap;
  78. .@{menuPrefixCls}-rtl & {
  79. padding: 7px 16px 7px 7px;
  80. }
  81. // Disabled state sets text to gray and nukes hover/tab effects
  82. &.@{menuPrefixCls}-item-disabled,
  83. &.@{menuPrefixCls}-submenu-disabled {
  84. color: #777 !important;
  85. }
  86. }
  87. &-item {
  88. display: flex;
  89. align-items: center;
  90. .@{menuPrefixCls}-item-extra {
  91. margin-left: auto;
  92. font-size: 14px;
  93. }
  94. }
  95. &-item-divider {
  96. height: 1px;
  97. margin: 1px 0;
  98. overflow: hidden;
  99. padding: 0;
  100. line-height: 0;
  101. background-color: #e5e5e5;
  102. }
  103. &-submenu {
  104. &-popup {
  105. position: absolute;
  106. .submenu-title-wrapper {
  107. padding-right: 20px;
  108. .@{menuPrefixCls}-submenu-rtl&,
  109. .@{menuPrefixCls}-submenu-rtl & {
  110. padding-right: 0;
  111. padding-left: 20px;
  112. }
  113. }
  114. }
  115. > .@{menuPrefixCls} {
  116. background-color: #fff;
  117. }
  118. }
  119. .@{menuPrefixCls}-submenu-title,
  120. .@{menuPrefixCls}-item {
  121. .anticon {
  122. width: 14px;
  123. height: 14px;
  124. margin-right: 8px;
  125. top: -1px;
  126. .@{menuPrefixCls}-rtl & {
  127. margin-right: 0;
  128. margin-left: 8px;
  129. }
  130. }
  131. }
  132. &-horizontal {
  133. background-color: #f3f5f7;
  134. border: none;
  135. border-bottom: 1px solid #d9d9d9;
  136. box-shadow: none;
  137. white-space: nowrap;
  138. overflow: hidden;
  139. & > .@{menuPrefixCls}-item,
  140. & > .@{menuPrefixCls}-submenu > .@{menuPrefixCls}-submenu-title {
  141. padding: 15px 20px;
  142. }
  143. & > .@{menuPrefixCls}-submenu,
  144. & > .@{menuPrefixCls}-item {
  145. border-bottom: 2px solid transparent;
  146. display: inline-block;
  147. vertical-align: bottom;
  148. &-active {
  149. border-bottom: 2px solid #2db7f5;
  150. background-color: #f3f5f7;
  151. color: #2baee9;
  152. }
  153. }
  154. &:after {
  155. content: '\20';
  156. display: block;
  157. height: 0;
  158. clear: both;
  159. }
  160. }
  161. &-vertical,
  162. &-vertical-left,
  163. &-vertical-right,
  164. &-inline {
  165. padding: 12px 0;
  166. & > .@{menuPrefixCls}-item,
  167. & > .@{menuPrefixCls}-submenu > .@{menuPrefixCls}-submenu-title {
  168. padding: 12px 8px 12px 24px;
  169. .@{menuPrefixCls}-rtl& {
  170. padding: 12px 24px 12px 8px;
  171. }
  172. }
  173. .@{menuPrefixCls}-submenu-arrow {
  174. display: inline-block;
  175. font: normal normal normal 14px/1 FontAwesome;
  176. font-size: inherit;
  177. vertical-align: baseline;
  178. text-align: center;
  179. text-transform: none;
  180. text-rendering: auto;
  181. position: absolute;
  182. right: 16px;
  183. line-height: 1.5em;
  184. &:before {
  185. content: '\f0da';
  186. .@{menuPrefixCls}-rtl&,
  187. .@{menuPrefixCls}-submenu-rtl & {
  188. content: '\f0d9';
  189. }
  190. }
  191. .@{menuPrefixCls}-rtl&,
  192. .@{menuPrefixCls}-submenu-rtl & {
  193. right: auto;
  194. left: 16px;
  195. }
  196. }
  197. }
  198. &-inline {
  199. .@{menuPrefixCls}-submenu-arrow {
  200. transform: rotate(90deg);
  201. transition: transform 0.3s;
  202. }
  203. & .@{menuPrefixCls}-submenu-open > .@{menuPrefixCls}-submenu-title {
  204. .@{menuPrefixCls}-submenu-arrow {
  205. transform: rotate(-90deg);
  206. }
  207. }
  208. }
  209. &-vertical&-sub,
  210. &-vertical-left&-sub,
  211. &-vertical-right&-sub {
  212. padding: 0;
  213. .@{menuPrefixCls}-submenu-rtl & {
  214. direction: rtl;
  215. }
  216. }
  217. &-sub&-inline {
  218. padding: 0;
  219. border: none;
  220. border-radius: 0;
  221. box-shadow: none;
  222. & > .@{menuPrefixCls}-item,
  223. & > .@{menuPrefixCls}-submenu > .@{menuPrefixCls}-submenu-title {
  224. padding-top: 8px;
  225. padding-bottom: 8px;
  226. padding-right: 0;
  227. .@{menuPrefixCls}-rtl & {
  228. padding-left: 0;
  229. }
  230. }
  231. }
  232. .effect() {
  233. animation-duration: 0.3s;
  234. animation-fill-mode: both;
  235. transform-origin: 0 0;
  236. }
  237. &-open {
  238. &-slide-up-enter,
  239. &-slide-up-appear {
  240. .effect();
  241. opacity: 0;
  242. animation-timing-function: cubic-bezier(0.08, 0.82, 0.17, 1);
  243. animation-play-state: paused;
  244. }
  245. &-slide-up-leave {
  246. .effect();
  247. opacity: 1;
  248. animation-timing-function: cubic-bezier(0.6, 0.04, 0.98, 0.34);
  249. animation-play-state: paused;
  250. }
  251. &-slide-up-enter&-slide-up-enter-active,
  252. &-slide-up-appear&-slide-up-appear-active {
  253. animation-name: rcMenuOpenSlideUpIn;
  254. animation-play-state: running;
  255. }
  256. &-slide-up-leave&-slide-up-leave-active {
  257. animation-name: rcMenuOpenSlideUpOut;
  258. animation-play-state: running;
  259. }
  260. @keyframes rcMenuOpenSlideUpIn {
  261. 0% {
  262. opacity: 0;
  263. transform-origin: 0% 0%;
  264. transform: scaleY(0);
  265. }
  266. 100% {
  267. opacity: 1;
  268. transform-origin: 0% 0%;
  269. transform: scaleY(1);
  270. }
  271. }
  272. @keyframes rcMenuOpenSlideUpOut {
  273. 0% {
  274. opacity: 1;
  275. transform-origin: 0% 0%;
  276. transform: scaleY(1);
  277. }
  278. 100% {
  279. opacity: 0;
  280. transform-origin: 0% 0%;
  281. transform: scaleY(0);
  282. }
  283. }
  284. &-zoom-enter,
  285. &-zoom-appear {
  286. opacity: 0;
  287. .effect();
  288. animation-timing-function: cubic-bezier(0.08, 0.82, 0.17, 1);
  289. animation-play-state: paused;
  290. }
  291. &-zoom-leave {
  292. .effect();
  293. animation-timing-function: cubic-bezier(0.6, 0.04, 0.98, 0.34);
  294. animation-play-state: paused;
  295. }
  296. &-zoom-enter&-zoom-enter-active,
  297. &-zoom-appear&-zoom-appear-active {
  298. animation-name: rcMenuOpenZoomIn;
  299. animation-play-state: running;
  300. }
  301. &-zoom-leave&-zoom-leave-active {
  302. animation-name: rcMenuOpenZoomOut;
  303. animation-play-state: running;
  304. }
  305. &-zoom-enter,
  306. &-zoom-appear,
  307. &-zoom-leave {
  308. .@{menuPrefixCls}-submenu-rtl&,
  309. .@{menuPrefixCls}-submenu-rtl & {
  310. transform-origin: top right !important;
  311. }
  312. }
  313. @keyframes rcMenuOpenZoomIn {
  314. 0% {
  315. opacity: 0;
  316. transform: scale(0, 0);
  317. }
  318. 100% {
  319. opacity: 1;
  320. transform: scale(1, 1);
  321. }
  322. }
  323. @keyframes rcMenuOpenZoomOut {
  324. 0% {
  325. transform: scale(1, 1);
  326. }
  327. 100% {
  328. opacity: 0;
  329. transform: scale(0, 0);
  330. }
  331. }
  332. }
  333. }