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.

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