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.

749 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. 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. /*
  329. .ui.selection.dropdown .menu .active.item {
  330. display: none;
  331. }*/
  332. /* Connecting Border */
  333. .ui.active.selection.dropdown,
  334. .ui.visible.selection.dropdown {
  335. border-bottom-left-radius: @selectionVisibleConnectingBorder !important;
  336. border-bottom-right-radius: @selectionVisibleConnectingBorder !important;
  337. }
  338. /*--------------
  339. Inline
  340. ---------------*/
  341. .ui.inline.dropdown {
  342. cursor: pointer;
  343. display: inline-block;
  344. color: @inlineTextColor;
  345. }
  346. .ui.inline.dropdown .dropdown.icon {
  347. margin: @inlineIconMargin;
  348. vertical-align: top;
  349. }
  350. .ui.inline.dropdown .text {
  351. font-weight: @inlineTextFontWeight;
  352. }
  353. .ui.inline.dropdown .menu {
  354. cursor: auto;
  355. margin-top: @inlineMenuDistance;
  356. border-radius: @inlineMenuBorderRadius;
  357. }
  358. /*******************************
  359. States
  360. *******************************/
  361. /* Dropdown Visible */
  362. .ui.visible.dropdown > .menu {
  363. display: block;
  364. }
  365. /*--------------------
  366. Hover
  367. ----------------------*/
  368. /* Menu Item Hover */
  369. .ui.dropdown .menu > .item:hover {
  370. background-color: rgba(0, 0, 0, 0.03);
  371. z-index: 12;
  372. }
  373. /*--------------------
  374. Active
  375. ----------------------*/
  376. /* Menu Item Active */
  377. .ui.dropdown .menu .active.item {
  378. background: @activeItemBackground;
  379. font-weight: @activeItemFontWeight;
  380. color: @activeItemColor;
  381. box-shadow: @activeItemBoxShadow;
  382. z-index: @activeItemZIndex;
  383. }
  384. /*--------------------
  385. Default Text
  386. ----------------------*/
  387. .ui.dropdown > .default.text,
  388. .ui.default.dropdown > .text {
  389. color: @defaultTextColor;
  390. }
  391. .ui.dropdown:hover > .default.text,
  392. .ui.default.dropdown:hover > .text {
  393. color: @defaultTextHoverColor;
  394. }
  395. /*--------------------
  396. Keyboard Select
  397. ----------------------*/
  398. /* Selected Item */
  399. .ui.dropdown.selected,
  400. .ui.dropdown .menu .selected.item {
  401. background: @selectedBackground;
  402. color: @selectedColor;
  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. /*--------------
  491. Fluid
  492. ---------------*/
  493. .ui.fluid.dropdown {
  494. display: block;
  495. }
  496. .ui.fluid.dropdown > .dropdown.icon {
  497. float: right;
  498. }
  499. /*--------------
  500. Floating
  501. ---------------*/
  502. .ui.floating.dropdown .menu {
  503. left: 0;
  504. right: auto;
  505. margin-top: @floatingMenuDistance !important;
  506. box-shadow: @floatingMenuBoxShadow;
  507. border-radius: @floatingMenuBorderRadius;
  508. }
  509. /*--------------
  510. Pointing
  511. ---------------*/
  512. .ui.pointing.dropdown > .menu {
  513. top: 100%;
  514. margin-top: @pointingMenuDistance;
  515. border-radius: @pointingMenuBorderRadius;
  516. }
  517. .ui.pointing.dropdown > .menu:after {
  518. display: block;
  519. position: absolute;
  520. pointer-events: none;
  521. content: '';
  522. visibility: visible;
  523. transform: rotate(45deg);
  524. width: @pointingArrowSize;
  525. height: @pointingArrowSize;
  526. box-shadow: @pointingArrowBoxShadow;
  527. background: @pointingArrowBackground;
  528. z-index: @pointingArrowZIndex;
  529. }
  530. .ui.pointing.dropdown > .menu:after {
  531. top: @pointingArrowOffset;
  532. left: 50%;
  533. margin: 0em 0em 0em @pointingArrowOffset;
  534. }
  535. /* Top Left Pointing */
  536. .ui.top.left.pointing.dropdown > .menu {
  537. top: 100%;
  538. bottom: auto;
  539. left: 0%;
  540. right: auto;
  541. margin: @pointingArrowDistanceFromEdge 0em 0em;
  542. }
  543. .ui.top.left.pointing.dropdown > .menu {
  544. top: 100%;
  545. bottom: auto;
  546. left: 0%;
  547. right: auto;
  548. margin: @pointingArrowDistanceFromEdge 0em 0em;
  549. }
  550. .ui.top.left.pointing.dropdown > .menu:after {
  551. top: @pointingArrowOffset;
  552. left: @pointingArrowDistanceFromEdge;
  553. right: auto;
  554. margin: 0em;
  555. transform: rotate(45deg);
  556. }
  557. /* Top Right Pointing */
  558. .ui.top.right.pointing.dropdown > .menu {
  559. top: 100%;
  560. bottom: auto;
  561. right: 0%;
  562. left: auto;
  563. margin: @pointingArrowDistanceFromEdge 0em 0em;
  564. }
  565. .ui.top.right.pointing.dropdown > .menu:after {
  566. top: @pointingArrowOffset;
  567. left: auto;
  568. right: @pointingArrowDistanceFromEdge;
  569. margin: 0em;
  570. transform: rotate(45deg);
  571. }
  572. /* Left Pointing */
  573. .ui.left.pointing.dropdown > .menu {
  574. top: 0%;
  575. left: 100%;
  576. right: auto;
  577. margin: 0em 0em 0em @pointingArrowDistanceFromEdge;
  578. }
  579. .ui.left.pointing.dropdown > .menu:after {
  580. top: 1em;
  581. left: @pointingArrowOffset;
  582. margin: 0em 0em 0em 0em;
  583. transform: rotate(-45deg);
  584. }
  585. /* Right Pointing */
  586. .ui.right.pointing.dropdown > .menu {
  587. top: 0%;
  588. left: auto;
  589. right: 100%;
  590. margin: 0em @pointingArrowDistanceFromEdge 0em 0em;
  591. }
  592. .ui.right.pointing.dropdown > .menu:after {
  593. top: 1em;
  594. left: auto;
  595. right: @pointingArrowOffset;
  596. margin: 0em 0em 0em 0em;
  597. transform: rotate(135deg);
  598. }
  599. /* Bottom Pointing */
  600. .ui.bottom.pointing.dropdown > .menu {
  601. top: auto;
  602. bottom: 100%;
  603. left: 0%;
  604. right: auto;
  605. margin: 0em 0em @pointingArrowDistanceFromEdge ;
  606. }
  607. .ui.bottom.pointing.dropdown > .menu:after {
  608. top: auto;
  609. bottom: @pointingArrowOffset;
  610. right: auto;
  611. margin: 0em;
  612. transform: rotate(-135deg);
  613. }
  614. /* Reverse Sub-Menu Direction */
  615. .ui.bottom.pointing.dropdown > .menu .menu {
  616. top: auto !important;
  617. bottom: 0px !important;
  618. }
  619. /* Bottom Left */
  620. .ui.bottom.left.pointing.dropdown > .menu {
  621. left: 0%;
  622. right: auto;
  623. }
  624. .ui.bottom.left.pointing.dropdown > .menu:after {
  625. left: @pointingArrowDistanceFromEdge;
  626. right: auto;
  627. }
  628. /* Bottom Right */
  629. .ui.bottom.right.pointing.dropdown > .menu {
  630. right: 0%;
  631. left: auto;
  632. }
  633. .ui.bottom.right.pointing.dropdown > .menu:after {
  634. left: auto;
  635. right: @pointingArrowDistanceFromEdge;
  636. }
  637. .loadUIOverrides();