You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

692 lines
14 KiB

10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
  1. /*
  2. * # Semantic - Dropdown
  3. * http://github.com/semantic-org/semantic-ui/
  4. *
  5. *
  6. * Copyright 2014 Contributor
  7. * Released under the MIT license
  8. * http://opensource.org/licenses/MIT
  9. *
  10. */
  11. /*******************************
  12. Theme
  13. *******************************/
  14. @type : 'module';
  15. @element : 'dropdown';
  16. @import '../../semantic.config';
  17. /*******************************
  18. Dropdown
  19. *******************************/
  20. .ui.dropdown {
  21. cursor: pointer;
  22. position: relative;
  23. display: inline-block;
  24. line-height: @lineHeight;
  25. transition: @transition;
  26. tap-highlight-color: rgba(0, 0, 0, 0);
  27. outline: none;
  28. }
  29. /*******************************
  30. Content
  31. *******************************/
  32. /*--------------
  33. Menu
  34. ---------------*/
  35. .ui.dropdown .menu {
  36. cursor: auto;
  37. position: absolute;
  38. display: none;
  39. top: 100%;
  40. margin: @menuMargin;
  41. padding: @menuPadding;
  42. background: @menuBackground;
  43. min-width: 100%;
  44. white-space: @menuWrap;
  45. font-size: 1rem;
  46. text-shadow: none;
  47. text-align: @menuTextAlign;
  48. box-shadow: @menuBoxShadow;
  49. border: @menuBorder;
  50. border-radius: @menuBorderRadius;
  51. transition: @menuTransition;
  52. z-index: @menuZIndex;
  53. will-change: transform, opacity;
  54. }
  55. /*--------------
  56. Dropdown Icon
  57. ---------------*/
  58. .ui.dropdown > .dropdown.icon {
  59. width: auto;
  60. margin: @dropdownIconMargin;
  61. }
  62. .ui.dropdown .menu > .item .dropdown.icon {
  63. width: auto;
  64. float: @dropdownSubMenuIconFloat;
  65. margin: @dropdownSubMenuIconMargin;
  66. }
  67. /*--------------
  68. Text
  69. ---------------*/
  70. .ui.dropdown > .text {
  71. display: inline-block;
  72. vertical-align: top;
  73. transition: @textTransition;
  74. }
  75. /*--------------
  76. Menu Item
  77. ---------------*/
  78. .ui.dropdown .menu > .item {
  79. position: relative;
  80. cursor: pointer;
  81. display: block;
  82. border: @itemBorder;
  83. height: @itemHeight;
  84. border-top: @itemDivider;
  85. line-height: @itemLineHeight;
  86. font-size: @itemFontSize;
  87. color: @itemColor;
  88. padding: @itemVerticalPadding @itemHorizontalPadding !important;
  89. font-size: @itemFontSize;
  90. text-transform: @itemTextTransform;
  91. font-weight: @itemFontWeight;
  92. box-shadow: @itemBoxShadow;
  93. -webkit-touch-callout: none;
  94. }
  95. .ui.dropdown .menu > .item:first-child {
  96. border-top: none;
  97. }
  98. /*--------------
  99. Menu Divider
  100. ---------------*/
  101. .ui.dropdown .menu > .header {
  102. margin: @menuHeaderMargin;
  103. padding: @menuHeaderPadding;
  104. color: @menuHeaderColor;
  105. font-size: @menuHeaderFontSize;
  106. font-weight: @menuHeaderFontWeight;
  107. text-transform: @menuHeaderTextTransform;
  108. }
  109. .ui.dropdown .menu > .divider {
  110. border-top: @menuDividerBorder;
  111. height: 0em;
  112. margin: @menuDividerMargin;
  113. }
  114. .ui.dropdown .menu > .input {
  115. margin: @menuInputMargin;
  116. min-width: @menuInputMinWidth;
  117. }
  118. .ui.dropdown .menu > .header + .input {
  119. margin-top: 0em;
  120. }
  121. .ui.dropdown .menu > .input:not(.transparent) input {
  122. padding: @menuInputPadding;
  123. }
  124. /*--------------
  125. Item Image
  126. ---------------*/
  127. .ui.dropdown .text > img,
  128. .ui.dropdown .text > .image,
  129. .ui.dropdown .menu > .item > .image,
  130. .ui.dropdown .menu > .item > img {
  131. display: inline-block;
  132. vertical-align: middle;
  133. width: auto;
  134. max-height: @menuImageMaxHeight;
  135. margin: @itemImageMargin;
  136. }
  137. /*--------------
  138. Sub Menu
  139. ---------------*/
  140. .ui.dropdown .menu .menu {
  141. top: @subMenuTop !important;
  142. left: @subMenuLeft !important;
  143. right: @subMenuRight !important;
  144. margin: @subMenuMargin !important;
  145. border-radius: @subMenuBorderRadius !important;
  146. }
  147. /* Hide Arrow */
  148. .ui.dropdown .menu .menu:after {
  149. display: none;
  150. }
  151. /*******************************
  152. Coupling
  153. *******************************/
  154. /* Icons / Flags / Labels */
  155. .ui.dropdown > .text > .icon,
  156. .ui.dropdown .menu > .item .icon {
  157. margin: @itemIconMargin;
  158. }
  159. .ui.dropdown > .text > .label,
  160. .ui.dropdown .menu > .item .label {
  161. margin: @itemLabelMargin;
  162. }
  163. .ui.dropdown > .text > .flag,
  164. .ui.dropdown .menu > .item .flag {
  165. margin: @itemFlagMargin;
  166. }
  167. /* Remove Menu Item Divider */
  168. .ui.dropdown .ui.menu > .item:before,
  169. .ui.menu .ui.dropdown .menu > .item:before {
  170. display: none;
  171. }
  172. /* Prevent Menu Item Border */
  173. .ui.menu .ui.dropdown .menu .active.item {
  174. border-left: none;
  175. }
  176. /* No Margin On Icon Button */
  177. .ui.dropdown.icon.button > .dropdown.icon {
  178. margin: 0em;
  179. }
  180. /* Automatically float dropdown menu right on last menu item */
  181. .ui.menu .right.menu .dropdown:last-child .menu,
  182. .ui.buttons > .ui.dropdown:last-child .menu {
  183. left: auto;
  184. right: 0em;
  185. }
  186. /*******************************
  187. Types
  188. *******************************/
  189. /*--------------
  190. Selection
  191. ---------------*/
  192. /* Displays like a select box */
  193. .ui.selection.dropdown {
  194. cursor: pointer;
  195. word-wrap: break-word;
  196. white-space: normal;
  197. outline: 0;
  198. transform: rotateZ(0deg);
  199. min-width: @selectionMinWidth;
  200. background: @selectionBackground;
  201. display: @selectionDisplay;
  202. padding: @selectionPadding;
  203. color: @selectionTextColor;
  204. box-shadow: @selectionBoxShadow;
  205. border: @selectionBorder;
  206. border-radius: @selectionBorderRadius;
  207. transition: @selectionTransition;
  208. }
  209. .ui.selection.dropdown.visible,
  210. .ui.selection.dropdown.active {
  211. z-index: @selectionZIndex;
  212. }
  213. select.ui.dropdown {
  214. height: 38px;
  215. padding: 0em;
  216. margin: 0em;
  217. visibility: hidden;
  218. }
  219. .ui.selection.dropdown > input[type="hidden"],
  220. .ui.selection.dropdown > select {
  221. display: none !important;
  222. }
  223. .ui.selection.dropdown > .text {
  224. margin-right: @selectionTextIconDistance;
  225. }
  226. .ui.selection.dropdown > .search.icon,
  227. .ui.selection.dropdown > .delete.icon,
  228. .ui.selection.dropdown > .dropdown.icon {
  229. position: absolute;
  230. top: auto;
  231. margin: 0em;
  232. width: auto;
  233. right: @selectionHorizontalPadding;
  234. opacity: @selectionIconOpacity;
  235. transition: @selectionIconTransition;
  236. }
  237. /* Remove Selection */
  238. .ui.selection.dropdown > .delete.icon {
  239. opacity: 0.6;
  240. }
  241. .ui.selection.dropdown > .delete.icon:hover {
  242. opacity: 1;
  243. }
  244. /* Search Selection Input */
  245. .ui.selection > input.search {
  246. cursor: pointer;
  247. background: none transparent;
  248. border: none;
  249. position: absolute;
  250. top: 0em;
  251. left: 0em;
  252. width: 100%;
  253. line-height: 1.2em;
  254. padding: @selectionPadding;
  255. outline: none;
  256. -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
  257. }
  258. .ui.selection.active > input.search,
  259. .ui.selection.visible > input.search {
  260. cursor: auto;
  261. }
  262. .ui.selection > input.search:focus + .text {
  263. color: @unselectedTextColor !important;
  264. }
  265. /* Selection Menu */
  266. .ui.selection.dropdown .menu {
  267. overflow-x: hidden;
  268. overflow-y: auto;
  269. max-height: @selectionMenuMaxHeight;
  270. box-shadow: @selectionMenuBoxShadow;
  271. transition: @selectionMenuTransition;
  272. border-top: none !important;
  273. width: auto;
  274. margin: 0px -1px;
  275. min-width: ~"calc(100% + 2px)";
  276. outline: none;
  277. }
  278. .ui.selection.dropdown .menu:after,
  279. .ui.selection.dropdown .menu:before {
  280. display: none;
  281. }
  282. .ui.selection.dropdown .menu > .item {
  283. padding-left: @selectionHorizontalPadding !important;
  284. /* Add in spacing for scroll bar */
  285. padding-right: calc(@selectionHorizontalPadding + 1em) !important;
  286. white-space: normal;
  287. word-wrap: normal;
  288. }
  289. /* Hover */
  290. .ui.selection.dropdown:hover {
  291. border: @selectionHoverBorder;
  292. box-shadow: @selectionHoverBoxShadow;
  293. }
  294. /* Visible Hover */
  295. .ui.selection.visible.dropdown:hover {
  296. border: @selectionVisibleHoverBorder;
  297. box-shadow: @selectionVisibleHoverBoxShadow;
  298. }
  299. .ui.selection.visible.dropdown:hover .menu {
  300. border: @selectionVisibleHoverMenuBorder;
  301. box-shadow: @selectionVisibleHoverMenuBoxShadow;
  302. }
  303. /* Visible */
  304. .ui.selection.dropdown.visible {
  305. border: @selectionVisibleBorder;
  306. box-shadow: @selectionVisibleBoxShadow;
  307. }
  308. .ui.visible.selection.dropdown > .dropdown.icon {
  309. opacity: @selectionVisibleIconOpacity;
  310. }
  311. /* Filtered Item */
  312. .ui.selection.dropdown .filtered.text {
  313. visibility: hidden;
  314. }
  315. .ui.selection.dropdown .filtered.item {
  316. display: none;
  317. }
  318. /* Active Item */
  319. .ui.selection.active.dropdown .text:not(.default),
  320. .ui.selection.visible.dropdown .text:not(.default) {
  321. font-weight: @selectionVisibleTextFontWeight;
  322. color: @selectionVisibleTextColor;
  323. }
  324. /*
  325. .ui.selection.dropdown .menu .active.item {
  326. display: none;
  327. }*/
  328. /* Connecting Border */
  329. .ui.active.selection.dropdown,
  330. .ui.visible.selection.dropdown {
  331. border-bottom-left-radius: @selectionVisibleConnectingBorder !important;
  332. border-bottom-right-radius: @selectionVisibleConnectingBorder !important;
  333. }
  334. /*--------------
  335. Inline
  336. ---------------*/
  337. .ui.inline.dropdown {
  338. cursor: pointer;
  339. display: inline-block;
  340. color: @inlineTextColor;
  341. }
  342. .ui.inline.dropdown .dropdown.icon {
  343. margin: @inlineIconMargin;
  344. vertical-align: top;
  345. }
  346. .ui.inline.dropdown .text {
  347. font-weight: @inlineTextFontWeight;
  348. }
  349. .ui.inline.dropdown .menu {
  350. cursor: auto;
  351. margin-top: @inlineMenuDistance;
  352. border-radius: @inlineMenuBorderRadius;
  353. }
  354. /*******************************
  355. States
  356. *******************************/
  357. /* Dropdown Visible */
  358. .ui.visible.dropdown > .menu {
  359. display: block;
  360. }
  361. /*--------------------
  362. Hover
  363. ----------------------*/
  364. /* Menu Item Hover */
  365. .ui.dropdown .menu > .item:hover {
  366. background-color: rgba(0, 0, 0, 0.03);
  367. z-index: 12;
  368. }
  369. /*--------------------
  370. Active
  371. ----------------------*/
  372. /* Menu Item Active */
  373. .ui.dropdown .menu .active.item {
  374. background: @activeItemBackground;
  375. font-weight: @activeItemFontWeight;
  376. color: @activeItemColor;
  377. box-shadow: @activeItemBoxShadow;
  378. z-index: @activeItemZIndex;
  379. }
  380. /*--------------------
  381. Default Text
  382. ----------------------*/
  383. .ui.dropdown > .default.text,
  384. .ui.default.dropdown > .text {
  385. color: @defaultTextColor;
  386. }
  387. .ui.dropdown:hover > .default.text,
  388. .ui.default.dropdown:hover > .text {
  389. color: @defaultTextHoverColor;
  390. }
  391. /*--------------------
  392. Keyboard Select
  393. ----------------------*/
  394. /* Selected Item */
  395. .ui.dropdown.selected,
  396. .ui.dropdown .menu .selected.item {
  397. background: @selectedBackground;
  398. color: @selectedColor;
  399. }
  400. /*--------------------
  401. Error
  402. ----------------------*/
  403. .ui.dropdown.error,
  404. .ui.dropdown.error > .text,
  405. .ui.dropdown.error > .default.text {
  406. color: @errorTextColor;
  407. }
  408. .ui.selection.dropdown.error {
  409. background: @errorBackgroundColor;
  410. border-color: @errorBorderColor;
  411. }
  412. .ui.selection.dropdown.error:hover {
  413. border-color: @errorBorderColor;
  414. }
  415. .ui.dropdown.error > .menu,
  416. .ui.dropdown.error > .menu .menu {
  417. border-color: @errorBorderColor;
  418. }
  419. .ui.dropdown.error > .menu > .item {
  420. color: @errorItemTextColor;
  421. }
  422. /* Item Hover */
  423. .ui.dropdown.error > .menu > .item:hover {
  424. background-color: @errorItemHoverBackground;
  425. }
  426. /* Item Active */
  427. .ui.dropdown.error > .menu .active.item {
  428. background-color: @errorItemActiveBackground;
  429. }
  430. /*******************************
  431. Variations
  432. *******************************/
  433. /*--------------
  434. Direction
  435. ---------------*/
  436. /* Flyout Direction */
  437. .ui.dropdown .menu {
  438. left: 0px;
  439. }
  440. /*--------------
  441. Simple
  442. ---------------*/
  443. /* Displays without javascript */
  444. .ui.simple.dropdown .menu:before,
  445. .ui.simple.dropdown .menu:after {
  446. display: none;
  447. }
  448. .ui.simple.dropdown .menu {
  449. position: absolute;
  450. display: block;
  451. overflow: hidden;
  452. top: -9999px !important;
  453. opacity: 0;
  454. width: 0;
  455. height: 0;
  456. transition: @simpleTransition;
  457. }
  458. .ui.simple.active.dropdown,
  459. .ui.simple.dropdown:hover {
  460. border-bottom-left-radius: 0em !important;
  461. border-bottom-right-radius: 0em !important;
  462. }
  463. .ui.simple.active.dropdown > .menu,
  464. .ui.simple.dropdown:hover > .menu {
  465. overflow: visible;
  466. width: auto;
  467. height: auto;
  468. top: 100% !important;
  469. opacity: 1;
  470. }
  471. .ui.simple.dropdown > .menu > .item:active > .menu,
  472. .ui.simple.dropdown:hover > .menu > .item:hover > .menu {
  473. overflow: visible;
  474. width: auto;
  475. height: auto;
  476. top: 0% !important;
  477. left: 100% !important;
  478. opacity: 1;
  479. }
  480. .ui.simple.disabled.dropdown:hover .menu {
  481. display: none;
  482. height: 0px;
  483. width: 0px;
  484. overflow: hidden;
  485. }
  486. /*--------------
  487. Fluid
  488. ---------------*/
  489. .ui.fluid.dropdown {
  490. display: block;
  491. }
  492. .ui.fluid.dropdown > .dropdown.icon {
  493. float: right;
  494. }
  495. /*--------------
  496. Floating
  497. ---------------*/
  498. .ui.floating.dropdown .menu {
  499. left: 0;
  500. right: auto;
  501. margin-top: @floatingMenuDistance !important;
  502. box-shadow: @floatingMenuBoxShadow;
  503. border-radius: @floatingMenuBorderRadius;
  504. }
  505. /*--------------
  506. Pointing
  507. ---------------*/
  508. .ui.pointing.dropdown > .menu {
  509. top: 100%;
  510. margin-top: @pointingMenuDistance;
  511. border-radius: @pointingMenuBorderRadius;
  512. }
  513. .ui.pointing.dropdown > .menu:after {
  514. display: block;
  515. position: absolute;
  516. pointer-events: none;
  517. content: '';
  518. visibility: visible;
  519. transform: rotate(45deg);
  520. width: @pointingArrowSize;
  521. height: @pointingArrowSize;
  522. box-shadow: @pointingArrowBoxShadow;
  523. background: @pointingArrowBackground;
  524. z-index: @pointingArrowZIndex;
  525. }
  526. /* Directions */
  527. .ui.pointing.dropdown > .menu:after {
  528. top: @pointingArrowOffset;
  529. left: 50%;
  530. margin: 0em 0em 0em @pointingArrowOffset;
  531. }
  532. .ui.top.left.pointing.dropdown > .menu {
  533. top: 100%;
  534. bottom: auto;
  535. left: 0%;
  536. right: auto;
  537. margin: @pointingArrowDistanceFromEdge 0em 0em;
  538. }
  539. .ui.top.left.pointing.dropdown > .menu:after {
  540. top: @pointingArrowOffset;
  541. left: @pointingArrowDistanceFromEdge;
  542. right: auto;
  543. margin: 0em;
  544. transform: rotate(45deg);
  545. }
  546. .ui.top.right.pointing.dropdown > .menu {
  547. top: 100%;
  548. bottom: auto;
  549. right: 0%;
  550. left: auto;
  551. margin: @pointingArrowDistanceFromEdge 0em 0em;
  552. }
  553. .ui.top.right.pointing.dropdown > .menu:after {
  554. top: @pointingArrowOffset;
  555. left: auto;
  556. right: @pointingArrowDistanceFromEdge;
  557. margin: 0em;
  558. transform: rotate(45deg);
  559. }
  560. .ui.left.pointing.dropdown > .menu {
  561. top: 0%;
  562. left: 100%;
  563. right: auto;
  564. margin: 0em 0em 0em @pointingArrowDistanceFromEdge;
  565. }
  566. .ui.left.pointing.dropdown > .menu:after {
  567. top: 1em;
  568. left: @pointingArrowOffset;
  569. margin: 0em 0em 0em 0em;
  570. transform: rotate(-45deg);
  571. }
  572. .ui.right.pointing.dropdown > .menu {
  573. top: 0%;
  574. left: auto;
  575. right: 100%;
  576. margin: 0em @pointingArrowDistanceFromEdge 0em 0em;
  577. }
  578. .ui.right.pointing.dropdown > .menu:after {
  579. top: 1em;
  580. left: auto;
  581. right: @pointingArrowOffset;
  582. margin: 0em 0em 0em 0em;
  583. transform: rotate(135deg);
  584. }
  585. .loadUIOverrides();