dropdown.css 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506
  1. /**
  2. * 下拉菜单模块
  3. * date:2019-07-12 License By http://easyweb.vip
  4. */
  5. .dropdown-no-scroll {
  6. overflow: hidden;
  7. }
  8. .dropdown-fixParent {
  9. z-index: auto;
  10. }
  11. /** 遮罩层 */
  12. .dropdown-menu-shade {
  13. position: fixed;
  14. left: 0;
  15. right: 0;
  16. top: 0;
  17. bottom: 0;
  18. z-index: 9998;
  19. background-color: rgba(0, 0, 0, .1);
  20. }
  21. .dropdown-menu-shade.no-shade {
  22. background-color: transparent;
  23. }
  24. /** 夜间主题 */
  25. .dropdown-menu-nav.dark {
  26. background: #32363F;
  27. border-color: #484e58;
  28. }
  29. .dropdown-menu-nav.dark > li > a {
  30. color: #a1a8b8;
  31. }
  32. .dropdown-menu-nav.dark > li > a:hover {
  33. background-color: #272b34;
  34. }
  35. .dropdown-menu-nav.dark > li.disabled > a, .dropdown-menu-nav > li.disabled > a:hover {
  36. color: #7a8191;
  37. }
  38. .dropdown-menu-nav.dark hr {
  39. background-color: #484e58;
  40. }
  41. .dropdown-menu-nav.dark > li.title {
  42. color: #868b9a;
  43. }
  44. .dropdown-menu-nav.dark .dropdown-anchor {
  45. border-color: #484e58;
  46. }
  47. .dropdown-menu-nav.dark .dropdown-anchor::after {
  48. border-color: #32363F;
  49. }
  50. /** 白色主题 */
  51. .dropdown-menu {
  52. position: relative;
  53. display: inline-block;
  54. }
  55. .dropdown-menu-nav {
  56. position: absolute;
  57. padding: 5px 0;
  58. margin: 0;
  59. overflow: visible;
  60. min-width: 110px;
  61. background: #fff;
  62. border-radius: 2px;
  63. box-shadow: 0 2px 4px rgba(0, 0, 0, .12);
  64. border: 1px solid #d2d2d2;
  65. text-align: left;
  66. z-index: 9999;
  67. }
  68. .dropdown-menu .dropdown-menu-nav {
  69. display: none;
  70. }
  71. .dropdown-menu.dropdown-open .dropdown-menu-nav {
  72. display: block;
  73. }
  74. .dropdown-menu-nav.fixed {
  75. position: fixed;
  76. }
  77. .dropdown-menu-nav > li {
  78. padding: 0;
  79. margin: 0;
  80. line-height: 18px;
  81. user-select: none;
  82. list-style: none;
  83. }
  84. .dropdown-menu-nav > li > a {
  85. display: block;
  86. color: #555;
  87. font-size: 14px;
  88. padding: 10px 15px;
  89. text-decoration: none;
  90. white-space: nowrap;
  91. cursor: pointer;
  92. user-select: none;
  93. }
  94. .dropdown-menu-nav > li > a:hover {
  95. background-color: #eeeeee;
  96. }
  97. .dropdown-menu-nav > li .layui-icon {
  98. font-size: 14px;
  99. margin-right: 5px;
  100. }
  101. .dropdown-menu-nav > hr {
  102. height: 1px;
  103. margin: 3px 0;
  104. background-color: #e6e6e6;
  105. }
  106. /** 禁用样式 */
  107. .dropdown-menu-nav > li.disabled {
  108. cursor: not-allowed;
  109. }
  110. .dropdown-menu-nav > li.disabled > a, .dropdown-menu-nav > li.disabled > a:hover {
  111. color: #999;
  112. cursor: not-allowed;
  113. pointer-events: none;
  114. background-color: transparent;
  115. }
  116. /** 标题样式 */
  117. .dropdown-menu-nav > li.title {
  118. color: #999;
  119. font-size: 12px;
  120. padding: 3px 15px;
  121. }
  122. /** 小箭头 */
  123. .dropdown-menu-nav .dropdown-anchor, .dropdown-menu-nav .dropdown-anchor:after {
  124. border: 8px solid #d2d2d2;
  125. position: absolute;
  126. display: inline-block;
  127. }
  128. .dropdown-menu-nav .dropdown-anchor:after {
  129. content: '';
  130. border: 7px solid #fff;
  131. }
  132. /** 下左位置 */
  133. .dropdown-menu-nav.dropdown-bottom-left {
  134. top: 100%;
  135. }
  136. .dropdown-menu-nav.dropdown-bottom-left {
  137. margin-top: 8px;
  138. }
  139. .dropdown-menu-nav.dropdown-bottom-left .dropdown-anchor, .dropdown-menu-nav.dropdown-bottom-left .dropdown-anchor:after {
  140. border-top-color: transparent;
  141. border-right-color: transparent;
  142. border-left-color: transparent;
  143. top: -16px;
  144. }
  145. .dropdown-menu-nav.dropdown-bottom-left .dropdown-anchor:after {
  146. top: -6px;
  147. left: -7px;
  148. }
  149. .dropdown-menu-nav.dropdown-bottom-left .dropdown-anchor {
  150. left: 12px;
  151. }
  152. /** 下右位置 */
  153. .dropdown-menu-nav.dropdown-bottom-right {
  154. right: 0;
  155. }
  156. .dropdown-menu-nav.dropdown-bottom-right {
  157. margin-top: 8px;
  158. }
  159. .dropdown-menu-nav.dropdown-bottom-right .dropdown-anchor, .dropdown-menu-nav.dropdown-bottom-right .dropdown-anchor:after {
  160. border-top-color: transparent;
  161. border-right-color: transparent;
  162. border-left-color: transparent;
  163. top: -16px;
  164. }
  165. .dropdown-menu-nav.dropdown-bottom-right .dropdown-anchor:after {
  166. top: -6px;
  167. left: -7px;
  168. }
  169. .dropdown-menu-nav.dropdown-bottom-right .dropdown-anchor {
  170. right: 12px;
  171. }
  172. /** 下中位置 */
  173. .dropdown-menu-nav.dropdown-bottom-center {
  174. left: 50%;
  175. /*transform: translateX(-50%);*/
  176. }
  177. .dropdown-menu-nav.dropdown-bottom-center {
  178. margin-top: 8px;
  179. }
  180. .dropdown-menu-nav.dropdown-bottom-center .dropdown-anchor, .dropdown-menu-nav.dropdown-bottom-center .dropdown-anchor:after {
  181. border-top-color: transparent;
  182. border-right-color: transparent;
  183. border-left-color: transparent;
  184. top: -16px;
  185. }
  186. .dropdown-menu-nav.dropdown-bottom-center .dropdown-anchor:after {
  187. top: -6px;
  188. left: -7px;
  189. }
  190. .dropdown-menu-nav.dropdown-bottom-center .dropdown-anchor {
  191. left: calc(50% - 8px);
  192. }
  193. /** 上左位置 */
  194. .dropdown-menu-nav.dropdown-top-left {
  195. bottom: 100%;
  196. }
  197. .dropdown-menu-nav.dropdown-top-left {
  198. margin-bottom: 8px;
  199. }
  200. .dropdown-menu-nav.dropdown-top-left .dropdown-anchor, .dropdown-menu-nav.dropdown-top-left .dropdown-anchor:after {
  201. border-bottom-color: transparent;
  202. border-right-color: transparent;
  203. border-left-color: transparent;
  204. bottom: -16px;
  205. }
  206. .dropdown-menu-nav.dropdown-top-left .dropdown-anchor:after {
  207. top: -8px;
  208. left: -7px;
  209. bottom: auto;
  210. }
  211. .dropdown-menu-nav.dropdown-top-left .dropdown-anchor {
  212. left: 12px;
  213. }
  214. /** 上右位置 */
  215. .dropdown-menu-nav.dropdown-top-right {
  216. bottom: 100%;
  217. right: 0;
  218. }
  219. .dropdown-menu-nav.dropdown-top-right {
  220. margin-bottom: 8px;
  221. }
  222. .dropdown-menu-nav.dropdown-top-right .dropdown-anchor, .dropdown-menu-nav.dropdown-top-right .dropdown-anchor:after {
  223. border-bottom-color: transparent;
  224. border-right-color: transparent;
  225. border-left-color: transparent;
  226. bottom: -16px;
  227. }
  228. .dropdown-menu-nav.dropdown-top-right .dropdown-anchor:after {
  229. top: -8px;
  230. left: -7px;
  231. bottom: auto;
  232. }
  233. .dropdown-menu-nav.dropdown-top-right .dropdown-anchor {
  234. right: 12px;
  235. }
  236. /** 上中位置 */
  237. .dropdown-menu-nav.dropdown-top-center {
  238. bottom: 100%;
  239. left: 50%;
  240. /*transform: translateX(-50%);*/
  241. }
  242. .dropdown-menu-nav.dropdown-top-center {
  243. margin-bottom: 8px;
  244. }
  245. .dropdown-menu-nav.dropdown-top-center .dropdown-anchor, .dropdown-menu-nav.dropdown-top-center .dropdown-anchor:after {
  246. border-bottom-color: transparent;
  247. border-right-color: transparent;
  248. border-left-color: transparent;
  249. bottom: -16px;
  250. }
  251. .dropdown-menu-nav.dropdown-top-center .dropdown-anchor:after {
  252. top: -8px;
  253. left: -7px;
  254. bottom: auto;
  255. }
  256. .dropdown-menu-nav.dropdown-top-center .dropdown-anchor {
  257. left: calc(50% - 8px);
  258. }
  259. /** 左上位置 */
  260. .dropdown-menu-nav.dropdown-left-top {
  261. right: 100%;
  262. bottom: 0;
  263. }
  264. .dropdown-menu-nav.dropdown-left-top {
  265. margin-right: 8px;
  266. }
  267. .dropdown-menu-nav.dropdown-left-top .dropdown-anchor, .dropdown-menu-nav.dropdown-left-top .dropdown-anchor:after {
  268. border-bottom-color: transparent;
  269. border-right-color: transparent;
  270. border-top-color: transparent;
  271. right: -16px;
  272. }
  273. .dropdown-menu-nav.dropdown-left-top .dropdown-anchor:after {
  274. top: -7px;
  275. left: -8px;
  276. right: auto;
  277. }
  278. .dropdown-menu-nav.dropdown-left-top .dropdown-anchor {
  279. bottom: 12px;
  280. }
  281. /** 左下位置 */
  282. .dropdown-menu-nav.dropdown-left-bottom {
  283. right: 100%;
  284. top: 0;
  285. }
  286. .dropdown-menu-nav.dropdown-left-bottom {
  287. margin-right: 8px;
  288. }
  289. .dropdown-menu-nav.dropdown-left-bottom .dropdown-anchor, .dropdown-menu-nav.dropdown-left-bottom .dropdown-anchor:after {
  290. border-bottom-color: transparent;
  291. border-right-color: transparent;
  292. border-top-color: transparent;
  293. right: -16px;
  294. }
  295. .dropdown-menu-nav.dropdown-left-bottom .dropdown-anchor:after {
  296. top: -7px;
  297. left: -8px;
  298. right: auto;
  299. }
  300. .dropdown-menu-nav.dropdown-left-bottom .dropdown-anchor {
  301. top: 12px;
  302. }
  303. /** 左中位置 */
  304. .dropdown-menu-nav.dropdown-left-center {
  305. right: 100%;
  306. top: 50%;
  307. /*transform: translateY(-50%);*/
  308. }
  309. .dropdown-menu-nav.dropdown-left-center {
  310. margin-right: 8px;
  311. }
  312. .dropdown-menu-nav.dropdown-left-center .dropdown-anchor, .dropdown-menu-nav.dropdown-left-center .dropdown-anchor:after {
  313. border-bottom-color: transparent;
  314. border-right-color: transparent;
  315. border-top-color: transparent;
  316. right: -16px;
  317. }
  318. .dropdown-menu-nav.dropdown-left-center .dropdown-anchor:after {
  319. top: -7px;
  320. left: -8px;
  321. right: auto;
  322. }
  323. .dropdown-menu-nav.dropdown-left-center .dropdown-anchor {
  324. top: calc(50% - 8px);
  325. }
  326. /** 右上位置 */
  327. .dropdown-menu-nav.dropdown-right-top {
  328. left: 100%;
  329. bottom: 0;
  330. }
  331. .dropdown-menu-nav.dropdown-right-top {
  332. margin-left: 8px;
  333. }
  334. .dropdown-menu-nav.dropdown-right-top .dropdown-anchor, .dropdown-menu-nav.dropdown-right-top .dropdown-anchor:after {
  335. border-bottom-color: transparent;
  336. border-left-color: transparent;
  337. border-top-color: transparent;
  338. left: -16px;
  339. }
  340. .dropdown-menu-nav.dropdown-right-top .dropdown-anchor:after {
  341. top: -7px;
  342. left: -6px;
  343. }
  344. .dropdown-menu-nav.dropdown-right-top .dropdown-anchor {
  345. bottom: 12px;
  346. }
  347. /** 右下位置 */
  348. .dropdown-menu-nav.dropdown-right-bottom {
  349. left: 100%;
  350. top: 0;
  351. }
  352. .dropdown-menu-nav.dropdown-right-bottom {
  353. margin-left: 8px;
  354. }
  355. .dropdown-menu-nav.dropdown-right-bottom .dropdown-anchor, .dropdown-menu-nav.dropdown-right-bottom .dropdown-anchor:after {
  356. border-bottom-color: transparent;
  357. border-left-color: transparent;
  358. border-top-color: transparent;
  359. left: -16px;
  360. }
  361. .dropdown-menu-nav.dropdown-right-bottom .dropdown-anchor:after {
  362. top: -7px;
  363. left: -6px;
  364. }
  365. .dropdown-menu-nav.dropdown-right-bottom .dropdown-anchor {
  366. top: 12px;
  367. }
  368. /** 右中位置 */
  369. .dropdown-menu-nav.dropdown-right-center {
  370. left: 100%;
  371. top: 50%;
  372. /*transform: translateY(-50%);*/
  373. }
  374. .dropdown-menu-nav.dropdown-right-center {
  375. margin-left: 8px;
  376. }
  377. .dropdown-menu-nav.dropdown-right-center .dropdown-anchor, .dropdown-menu-nav.dropdown-right-center .dropdown-anchor:after {
  378. border-bottom-color: transparent;
  379. border-left-color: transparent;
  380. border-top-color: transparent;
  381. left: -16px;
  382. }
  383. .dropdown-menu-nav.dropdown-right-center .dropdown-anchor:after {
  384. top: -7px;
  385. left: -6px;
  386. }
  387. .dropdown-menu-nav.dropdown-right-center .dropdown-anchor {
  388. top: calc(50% - 8px);
  389. }
  390. /** 按钮里面三角形样式 */
  391. .icon-btn .layui-icon-drop {
  392. margin-right: 0;
  393. font-size: 14px;
  394. }
  395. .layui-icon-drop:before {
  396. content: "\e625";
  397. }
  398. .layui-icon-drop.top {
  399. transform: rotate(180deg);
  400. display: inline-table;
  401. }
  402. .layui-icon-drop.left {
  403. transform: rotate(90deg);
  404. display: inline-table;
  405. }
  406. .layui-icon-drop.right {
  407. transform: rotate(-90deg);
  408. display: inline-table;
  409. }
  410. .dropdown-menu + .dropdown-menu, .layui-btn + .dropdown-menu, .dropdown-menu + .layui-btn {
  411. margin-left: 10px;
  412. }