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.

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