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.

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