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.

779 lines
16 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. box-shadow: @selectionMenuBoxShadow;
  282. transition: @selectionMenuTransition;
  283. }
  284. .ui.selection.dropdown .menu:after,
  285. .ui.selection.dropdown .menu:before {
  286. display: none;
  287. }
  288. @media only screen and (max-width : @largestMobileScreen) {
  289. .ui.selection.dropdown .menu {
  290. max-height: @selectionMobileMaxMenuHeight;
  291. }
  292. }
  293. @media only screen and (min-width: @tabletBreakpoint) {
  294. .ui.selection.dropdown .menu {
  295. max-height: @selectionTabletMaxMenuHeight;
  296. }
  297. }
  298. @media only screen and (min-width: @computerBreakpoint) {
  299. .ui.selection.dropdown .menu {
  300. max-height: @selectionComputerMaxMenuHeight;
  301. }
  302. }
  303. @media only screen and (min-width: @widescreenMonitorBreakpoint) {
  304. .ui.selection.dropdown .menu {
  305. max-height: @selectionWidescreenMaxMenuHeight;
  306. }
  307. }
  308. /* Menu Item */
  309. .ui.selection.dropdown .menu > .item {
  310. border-top: @selectionItemDivider;
  311. padding-left: @selectionHorizontalPadding !important;
  312. /* Add in spacing for scroll bar */
  313. padding-right: calc(@selectionHorizontalPadding + 1em) !important;
  314. white-space: normal;
  315. word-wrap: normal;
  316. }
  317. /* Hover */
  318. .ui.selection.dropdown:hover {
  319. border-color: @selectionHoverBorderColor;
  320. box-shadow: @selectionHoverBoxShadow;
  321. }
  322. /* Visible Hover */
  323. .ui.selection.visible.dropdown:hover {
  324. border-color: @selectionVisibleHoverBorderColor;
  325. box-shadow: @selectionVisibleHoverBoxShadow;
  326. }
  327. .ui.selection.visible.dropdown:hover .menu {
  328. border: @selectionVisibleHoverMenuBorder;
  329. box-shadow: @selectionVisibleHoverMenuBoxShadow;
  330. }
  331. /* Visible */
  332. .ui.selection.dropdown.visible {
  333. border-color: @selectionVisibleBorderColor;
  334. box-shadow: @selectionVisibleBoxShadow;
  335. }
  336. .ui.visible.selection.dropdown > .dropdown.icon {
  337. opacity: @selectionVisibleIconOpacity;
  338. }
  339. /* Active Item */
  340. .ui.selection.active.dropdown .text:not(.default),
  341. .ui.selection.visible.dropdown .text:not(.default) {
  342. font-weight: @selectionVisibleTextFontWeight;
  343. color: @selectionVisibleTextColor;
  344. }
  345. /* Connecting Border */
  346. .ui.active.selection.dropdown,
  347. .ui.visible.selection.dropdown {
  348. border-bottom-left-radius: @selectionVisibleConnectingBorder !important;
  349. border-bottom-right-radius: @selectionVisibleConnectingBorder !important;
  350. }
  351. /*--------------
  352. Inline
  353. ---------------*/
  354. .ui.inline.dropdown {
  355. cursor: pointer;
  356. display: inline-block;
  357. color: @inlineTextColor;
  358. }
  359. .ui.inline.dropdown .dropdown.icon {
  360. margin: @inlineIconMargin;
  361. vertical-align: top;
  362. }
  363. .ui.inline.dropdown .text {
  364. font-weight: @inlineTextFontWeight;
  365. }
  366. .ui.inline.dropdown .menu {
  367. cursor: auto;
  368. margin-top: @inlineMenuDistance;
  369. border-radius: @inlineMenuBorderRadius;
  370. }
  371. /*******************************
  372. States
  373. *******************************/
  374. /*--------------------
  375. Hover
  376. ----------------------*/
  377. /* Menu Item Hover */
  378. .ui.dropdown .menu > .item:hover {
  379. background: @hoveredItemBackground;
  380. color: @hoveredItemColor;
  381. z-index: 12;
  382. }
  383. /*--------------------
  384. Active
  385. ----------------------*/
  386. /* Menu Item Active */
  387. .ui.dropdown .menu .active.item {
  388. background: @activeItemBackground;
  389. font-weight: @activeItemFontWeight;
  390. color: @activeItemColor;
  391. box-shadow: @activeItemBoxShadow;
  392. z-index: @activeItemZIndex;
  393. }
  394. /*--------------------
  395. Default Text
  396. ----------------------*/
  397. .ui.dropdown > .default.text,
  398. .ui.default.dropdown > .text {
  399. color: @defaultTextColor;
  400. }
  401. .ui.dropdown:hover > .default.text,
  402. .ui.default.dropdown:hover > .text {
  403. color: @defaultTextHoverColor;
  404. }
  405. /*--------------------
  406. Keyboard Select
  407. ----------------------*/
  408. /* Selected Item */
  409. .ui.dropdown.selected,
  410. .ui.dropdown .menu .selected.item {
  411. background: @selectedBackground;
  412. color: @selectedColor;
  413. }
  414. /*--------------------
  415. Search Filtered
  416. ----------------------*/
  417. /* Filtered Item */
  418. .ui.dropdown .filtered.text {
  419. visibility: hidden;
  420. }
  421. .ui.dropdown .filtered.item {
  422. display: none;
  423. }
  424. /*--------------------
  425. Error
  426. ----------------------*/
  427. .ui.dropdown.error,
  428. .ui.dropdown.error > .text,
  429. .ui.dropdown.error > .default.text {
  430. color: @errorTextColor;
  431. }
  432. .ui.selection.dropdown.error {
  433. background: @errorBackgroundColor;
  434. border-color: @errorBorderColor;
  435. }
  436. .ui.selection.dropdown.error:hover {
  437. border-color: @errorBorderColor;
  438. }
  439. .ui.dropdown.error > .menu,
  440. .ui.dropdown.error > .menu .menu {
  441. border-color: @errorBorderColor;
  442. }
  443. .ui.dropdown.error > .menu > .item {
  444. color: @errorItemTextColor;
  445. }
  446. /* Item Hover */
  447. .ui.dropdown.error > .menu > .item:hover {
  448. background-color: @errorItemHoverBackground;
  449. }
  450. /* Item Active */
  451. .ui.dropdown.error > .menu .active.item {
  452. background-color: @errorItemActiveBackground;
  453. }
  454. /*******************************
  455. Variations
  456. *******************************/
  457. /*--------------
  458. Direction
  459. ---------------*/
  460. /* Flyout Direction */
  461. .ui.dropdown .menu {
  462. left: 0px;
  463. }
  464. /*--------------
  465. Simple
  466. ---------------*/
  467. /* Displays without javascript */
  468. .ui.simple.dropdown .menu:before,
  469. .ui.simple.dropdown .menu:after {
  470. display: none;
  471. }
  472. .ui.simple.dropdown .menu {
  473. position: absolute;
  474. display: block;
  475. overflow: hidden;
  476. top: -9999px !important;
  477. opacity: 0;
  478. width: 0;
  479. height: 0;
  480. transition: @simpleTransition;
  481. }
  482. .ui.simple.active.dropdown,
  483. .ui.simple.dropdown:hover {
  484. border-bottom-left-radius: 0em !important;
  485. border-bottom-right-radius: 0em !important;
  486. }
  487. .ui.simple.active.dropdown > .menu,
  488. .ui.simple.dropdown:hover > .menu {
  489. overflow: visible;
  490. width: auto;
  491. height: auto;
  492. top: 100% !important;
  493. opacity: 1;
  494. }
  495. .ui.simple.dropdown > .menu > .item:active > .menu,
  496. .ui.simple.dropdown:hover > .menu > .item:hover > .menu {
  497. overflow: visible;
  498. width: auto;
  499. height: auto;
  500. top: 0% !important;
  501. left: 100% !important;
  502. opacity: 1;
  503. }
  504. .ui.simple.disabled.dropdown:hover .menu {
  505. display: none;
  506. height: 0px;
  507. width: 0px;
  508. overflow: hidden;
  509. }
  510. /* Visible */
  511. .ui.simple.visible.dropdown > .menu {
  512. display: block;
  513. }
  514. /*--------------
  515. Fluid
  516. ---------------*/
  517. .ui.fluid.dropdown {
  518. display: block;
  519. width: 100%;
  520. min-width: 0em;
  521. }
  522. .ui.fluid.dropdown > .dropdown.icon {
  523. float: right;
  524. }
  525. /*--------------
  526. Floating
  527. ---------------*/
  528. .ui.floating.dropdown .menu {
  529. left: 0;
  530. right: auto;
  531. margin-top: @floatingMenuDistance !important;
  532. box-shadow: @floatingMenuBoxShadow;
  533. border-radius: @floatingMenuBorderRadius;
  534. }
  535. /*--------------
  536. Pointing
  537. ---------------*/
  538. .ui.pointing.dropdown > .menu {
  539. top: 100%;
  540. margin-top: @pointingMenuDistance;
  541. border-radius: @pointingMenuBorderRadius;
  542. }
  543. .ui.pointing.dropdown > .menu:after {
  544. display: block;
  545. position: absolute;
  546. pointer-events: none;
  547. content: '';
  548. visibility: visible;
  549. transform: rotate(45deg);
  550. width: @pointingArrowSize;
  551. height: @pointingArrowSize;
  552. box-shadow: @pointingArrowBoxShadow;
  553. background: @pointingArrowBackground;
  554. z-index: @pointingArrowZIndex;
  555. }
  556. .ui.pointing.dropdown > .menu:after {
  557. top: @pointingArrowOffset;
  558. left: 50%;
  559. margin: 0em 0em 0em @pointingArrowOffset;
  560. }
  561. /* Top Left Pointing */
  562. .ui.top.left.pointing.dropdown > .menu {
  563. top: 100%;
  564. bottom: auto;
  565. left: 0%;
  566. right: auto;
  567. margin: @pointingArrowDistanceFromEdge 0em 0em;
  568. }
  569. .ui.top.left.pointing.dropdown > .menu {
  570. top: 100%;
  571. bottom: auto;
  572. left: 0%;
  573. right: auto;
  574. margin: @pointingArrowDistanceFromEdge 0em 0em;
  575. }
  576. .ui.top.left.pointing.dropdown > .menu:after {
  577. top: @pointingArrowOffset;
  578. left: @pointingArrowDistanceFromEdge;
  579. right: auto;
  580. margin: 0em;
  581. transform: rotate(45deg);
  582. }
  583. /* Top Right Pointing */
  584. .ui.top.right.pointing.dropdown > .menu {
  585. top: 100%;
  586. bottom: auto;
  587. right: 0%;
  588. left: auto;
  589. margin: @pointingArrowDistanceFromEdge 0em 0em;
  590. }
  591. .ui.top.right.pointing.dropdown > .menu:after {
  592. top: @pointingArrowOffset;
  593. left: auto;
  594. right: @pointingArrowDistanceFromEdge;
  595. margin: 0em;
  596. transform: rotate(45deg);
  597. }
  598. /* Left Pointing */
  599. .ui.left.pointing.dropdown > .menu {
  600. top: 0%;
  601. left: 100%;
  602. right: auto;
  603. margin: 0em 0em 0em @pointingArrowDistanceFromEdge;
  604. }
  605. .ui.left.pointing.dropdown > .menu:after {
  606. top: 1em;
  607. left: @pointingArrowOffset;
  608. margin: 0em 0em 0em 0em;
  609. transform: rotate(-45deg);
  610. }
  611. /* Right Pointing */
  612. .ui.right.pointing.dropdown > .menu {
  613. top: 0%;
  614. left: auto;
  615. right: 100%;
  616. margin: 0em @pointingArrowDistanceFromEdge 0em 0em;
  617. }
  618. .ui.right.pointing.dropdown > .menu:after {
  619. top: 1em;
  620. left: auto;
  621. right: @pointingArrowOffset;
  622. margin: 0em 0em 0em 0em;
  623. transform: rotate(135deg);
  624. }
  625. /* Bottom Pointing */
  626. .ui.bottom.pointing.dropdown > .menu {
  627. top: auto;
  628. bottom: 100%;
  629. left: 0%;
  630. right: auto;
  631. margin: 0em 0em @pointingArrowDistanceFromEdge ;
  632. }
  633. .ui.bottom.pointing.dropdown > .menu:after {
  634. top: auto;
  635. bottom: @pointingArrowOffset;
  636. right: auto;
  637. margin: 0em;
  638. transform: rotate(-135deg);
  639. }
  640. /* Reverse Sub-Menu Direction */
  641. .ui.bottom.pointing.dropdown > .menu .menu {
  642. top: auto !important;
  643. bottom: 0px !important;
  644. }
  645. /* Bottom Left */
  646. .ui.bottom.left.pointing.dropdown > .menu {
  647. left: 0%;
  648. right: auto;
  649. }
  650. .ui.bottom.left.pointing.dropdown > .menu:after {
  651. left: @pointingArrowDistanceFromEdge;
  652. right: auto;
  653. }
  654. /* Bottom Right */
  655. .ui.bottom.right.pointing.dropdown > .menu {
  656. right: 0%;
  657. left: auto;
  658. }
  659. .ui.bottom.right.pointing.dropdown > .menu:after {
  660. left: auto;
  661. right: @pointingArrowDistanceFromEdge;
  662. }
  663. .loadUIOverrides();