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.

536 lines
10 KiB

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. }
  28. /*******************************
  29. Content
  30. *******************************/
  31. /*--------------
  32. Menu
  33. ---------------*/
  34. .ui.dropdown .menu {
  35. cursor: auto;
  36. position: absolute;
  37. display: none;
  38. top: 100%;
  39. margin: @menuMargin;
  40. padding: @menuPadding;
  41. background: @menuBackground;
  42. min-width: 100%;
  43. white-space: @menuWrap;
  44. font-size: 1rem;
  45. text-shadow: none;
  46. box-shadow: @menuBoxShadow;
  47. border-radius: @menuBorderRadius;
  48. transition: @menuTransition;
  49. z-index: @menuZIndex;
  50. will-change: transform, opacity;
  51. }
  52. /*--------------
  53. Icon
  54. ---------------*/
  55. .ui.dropdown > .dropdown.icon {
  56. width: auto;
  57. margin: @dropdownIconMargin;
  58. }
  59. .ui.dropdown .menu .item .dropdown.icon {
  60. width: auto;
  61. float: @dropdownSubMenuIconFloat;
  62. margin: @dropdownSubMenuIconMargin;
  63. }
  64. /*--------------
  65. Text
  66. ---------------*/
  67. .ui.dropdown > .text {
  68. display: inline-block;
  69. vertical-align: top;
  70. transition: @textTransition;
  71. }
  72. /*--------------
  73. Menu Item
  74. ---------------*/
  75. .ui.dropdown .menu .item {
  76. cursor: pointer;
  77. display: block;
  78. border: @itemBorder;
  79. height: @itemHeight;
  80. border-top: @itemDivider;
  81. font-size: @itemFontSize;
  82. color: @itemColor;
  83. padding: @itemVerticalPadding @itemHorizontalPadding !important;
  84. font-size: @itemFontSize;
  85. text-transform: @itemTextTransform;
  86. font-weight: @itemFontWeight;
  87. text-align: @itemTextAlign;
  88. box-shadow: @itemBoxShadow;
  89. -webkit-touch-callout: none;
  90. }
  91. .ui.dropdown .menu .item .icon {
  92. margin: @itemIconMargin;
  93. }
  94. .ui.dropdown .menu .item:first-child {
  95. border-top: none;
  96. }
  97. /*--------------
  98. Item Image
  99. ---------------*/
  100. .ui.dropdown .menu .item > img {
  101. height: 2.5em;
  102. display: inline-block;
  103. vertical-align: middle;
  104. margin-right: 0.5em;
  105. }
  106. /*--------------
  107. Sub Menu
  108. ---------------*/
  109. .ui.dropdown .menu .menu {
  110. top: @subMenuTop !important;
  111. left: @subMenuLeft !important;
  112. right: @subMenuRight !important;
  113. margin: @subMenuMargin !important;
  114. border-radius: @subMenuBorderRadius !important;
  115. }
  116. /* Hide Arrow */
  117. .ui.dropdown .menu .menu:after {
  118. display: none;
  119. }
  120. /*******************************
  121. Coupling
  122. *******************************/
  123. /* Remove Menu Item Divider */
  124. .ui.dropdown .ui.menu .item:before,
  125. .ui.menu .ui.dropdown .menu .item:before {
  126. display: none;
  127. }
  128. /* Prevent Menu Item Border */
  129. .ui.menu .ui.dropdown .menu .active.item {
  130. border-left: none;
  131. }
  132. /* No Margin On Icon Button */
  133. .ui.dropdown.icon.button > .dropdown.icon {
  134. margin: 0em;
  135. }
  136. /* Automatically float dropdown menu right on last menu item */
  137. .ui.menu .right.menu .dropdown:last-child .menu,
  138. .ui.buttons > .ui.dropdown:last-child .menu {
  139. left: auto;
  140. right: 0em;
  141. }
  142. /*******************************
  143. Types
  144. *******************************/
  145. /*--------------
  146. Selection
  147. ---------------*/
  148. /* Displays like a select box */
  149. .ui.selection.dropdown {
  150. cursor: pointer;
  151. word-wrap: break-word;
  152. white-space: normal;
  153. outline: 0;
  154. background: @selectionBackground;
  155. display: @selectionDisplay;
  156. padding: @selectionVerticalPadding @selectionHorizontalPadding;
  157. color: @selectionTextColor;
  158. box-shadow: @selectionBoxShadow !important;
  159. border-radius: @selectionBorderRadius !important;
  160. /* Matches selection dropdown height to input height */
  161. border-top: 1px solid transparent;
  162. }
  163. .ui.selection.dropdown.active {
  164. transform: rotateZ(0deg);
  165. z-index: 10;
  166. }
  167. .ui.selection.dropdown select {
  168. display: none;
  169. }
  170. .ui.selection.dropdown > .dropdown.icon {
  171. opacity: @selectionIconOpacity;
  172. margin: @selectionIconMargin;
  173. transition: @selectionIconTransition;
  174. }
  175. .ui.selection.dropdown .menu {
  176. overflow-x: hidden;
  177. overflow-y: auto;
  178. max-height: @selectionMenuMaxHeight;
  179. box-shadow: @selectionMenuBoxShadow;
  180. }
  181. .ui.selection.dropdown .menu:after,
  182. .ui.selection.dropdown .menu:before {
  183. display: none;
  184. }
  185. /* Hover */
  186. .ui.selection.dropdown:hover {
  187. box-shadow: @selectionHoverBoxShadow !important;
  188. }
  189. .ui.selection.dropdown:hover .menu {
  190. box-shadow: @selectionHoverMenuBoxShadow;
  191. }
  192. .ui.selection.dropdown:hover > .dropdown.icon {
  193. opacity: @selectionHoverIconOpacity;
  194. }
  195. /* Connecting Border */
  196. .ui.active.selection.dropdown,
  197. .ui.visible.selection.dropdown {
  198. border-bottom-left-radius: @selectionVisibleConnectingBorder !important;
  199. border-bottom-right-radius: @selectionVisibleConnectingBorder !important;
  200. }
  201. .ui.active.selection.dropdown > .dropdown.icon {
  202. opacity: @selectionActiveIconOpacity;
  203. }
  204. /*--------------
  205. Inline
  206. ---------------*/
  207. .ui.inline.dropdown {
  208. cursor: pointer;
  209. display: inline-block;
  210. color: @inlineTextColor;
  211. }
  212. .ui.inline.dropdown .dropdown.icon {
  213. margin: @inlineIconMargin;
  214. vertical-align: top;
  215. }
  216. .ui.inline.dropdown .text {
  217. font-weight: @inlineTextFontWeight;
  218. }
  219. .ui.inline.dropdown .menu {
  220. cursor: auto;
  221. margin-top: @inlineMenuDistance;
  222. border-radius: @inlineMenuBorderRadius;
  223. }
  224. /*******************************
  225. States
  226. *******************************/
  227. /* Dropdown Visible */
  228. .ui.visible.dropdown > .menu {
  229. display: block;
  230. }
  231. /*--------------------
  232. Hover
  233. ----------------------*/
  234. /* Menu Item Hover */
  235. .ui.dropdown .menu .item:hover {
  236. background-color: rgba(0, 0, 0, 0.03);
  237. z-index: 12;
  238. }
  239. /*--------------------
  240. Active
  241. ----------------------*/
  242. /* Menu Item Active */
  243. .ui.dropdown .menu .active.item {
  244. background: @activeItemBackground;
  245. font-weight: @activeItemFontWeight;
  246. color: @activeItemColor;
  247. box-shadow: @activeItemBoxShadow;
  248. z-index: @activeItemZIndex;
  249. }
  250. /*--------------------
  251. Default Text
  252. ----------------------*/
  253. .ui.dropdown > .default.text,
  254. .ui.default.dropdown > .text {
  255. color: @defaultTextColor;
  256. }
  257. .ui.dropdown:hover > .default.text,
  258. .ui.default.dropdown:hover > .text {
  259. color: @defaultTextHoverColor;
  260. }
  261. /*--------------------
  262. Error
  263. ----------------------*/
  264. .ui.dropdown.error,
  265. .ui.dropdown.error > .text,
  266. .ui.dropdown.error > .default.text {
  267. color: @errorTextColor !important;
  268. }
  269. .ui.selection.dropdown.error {
  270. background: @errorBackgroundColor;
  271. box-shadow: 0px 0px 0px 1px @errorBorderColor !important;
  272. }
  273. .ui.selection.dropdown.error:hover {
  274. box-shadow: 0px 0px 0px 1px @errorBorderColor !important;
  275. }
  276. .ui.dropdown.error > .menu,
  277. .ui.dropdown.error > .menu .menu {
  278. box-shadow: 0px 0px 1px 1px @errorBorderColor !important;
  279. }
  280. .ui.dropdown.error > .menu .item {
  281. color: #D95C5C !important;
  282. }
  283. /* Item Hover */
  284. .ui.dropdown.error > .menu .item:hover {
  285. background-color: #FFF2F2 !important;
  286. }
  287. /* Item Active */
  288. .ui.dropdown.error > .menu .active.item {
  289. background-color: #FDCFCF !important;
  290. }
  291. /*******************************
  292. Variations
  293. *******************************/
  294. /*--------------
  295. Direction
  296. ---------------*/
  297. /* Flyout Direction */
  298. .ui.dropdown .menu {
  299. left: 0px;
  300. }
  301. /*--------------
  302. Simple
  303. ---------------*/
  304. /* Displays without javascript */
  305. .ui.simple.dropdown .menu:before,
  306. .ui.simple.dropdown .menu:after {
  307. display: none;
  308. }
  309. .ui.simple.dropdown .menu {
  310. position: absolute;
  311. display: block;
  312. overflow: hidden;
  313. top: -9999px !important;
  314. opacity: 0;
  315. width: 0;
  316. height: 0;
  317. transition: @simpleTransition;
  318. }
  319. .ui.simple.active.dropdown,
  320. .ui.simple.dropdown:hover {
  321. border-bottom-left-radius: 0em !important;
  322. border-bottom-right-radius: 0em !important;
  323. }
  324. .ui.simple.active.dropdown > .menu,
  325. .ui.simple.dropdown:hover > .menu {
  326. overflow: visible;
  327. width: auto;
  328. height: auto;
  329. top: 100% !important;
  330. opacity: 1;
  331. }
  332. .ui.simple.dropdown > .menu .item:active > .menu,
  333. .ui.simple.dropdown:hover > .menu .item:hover > .menu {
  334. overflow: visible;
  335. width: auto;
  336. height: auto;
  337. top: 0% !important;
  338. left: 100% !important;
  339. opacity: 1;
  340. }
  341. .ui.simple.disabled.dropdown:hover .menu {
  342. display: none;
  343. height: 0px;
  344. width: 0px;
  345. overflow: hidden;
  346. }
  347. /*--------------
  348. Fluid
  349. ---------------*/
  350. .ui.fluid.dropdown {
  351. display: block;
  352. }
  353. .ui.fluid.dropdown > .dropdown.icon {
  354. float: right;
  355. }
  356. /*--------------
  357. Floating
  358. ---------------*/
  359. .ui.floating.dropdown .menu {
  360. left: 0;
  361. right: auto;
  362. margin-top: @floatingMenuDistance !important;
  363. box-shadow: @floatingMenuBoxShadow;
  364. border-radius: @floatingMenuBorderRadius;
  365. }
  366. /*--------------
  367. Pointing
  368. ---------------*/
  369. .ui.pointing.dropdown .menu {
  370. top: 100%;
  371. margin-top: @pointingMenuDistance;
  372. border-radius: @pointingMenuBorderRadius;
  373. }
  374. .ui.pointing.dropdown .menu:after {
  375. display: block;
  376. position: absolute;
  377. pointer-events: none;
  378. content: '';
  379. visibility: visible;
  380. transform: rotate(45deg);
  381. width: @pointingArrowSize;
  382. height: @pointingArrowSize;
  383. box-shadow: @pointingArrowBoxShadow;
  384. background: @pointingArrowBackground;
  385. z-index: @pointingArrowZIndex;
  386. }
  387. /* Directions */
  388. .ui.pointing.dropdown .menu:after {
  389. top: @pointingArrowOffset;
  390. left: 50%;
  391. margin: 0em 0em 0em @pointingArrowOffset;
  392. }
  393. .ui.top.left.pointing.dropdown .menu {
  394. top: 100%;
  395. bottom: auto;
  396. left: 0%;
  397. right: auto;
  398. margin: @pointingArrowDistanceFromEdge 0em 0em;
  399. }
  400. .ui.top.left.pointing.dropdown .menu:after {
  401. top: @pointingArrowOffset;
  402. left: @pointingArrowDistanceFromEdge;
  403. right: auto;
  404. margin: 0em;
  405. transform: rotate(45deg);
  406. }
  407. .ui.top.right.pointing.dropdown .menu {
  408. top: 100%;
  409. bottom: auto;
  410. right: 0%;
  411. left: auto;
  412. margin: @pointingArrowDistanceFromEdge 0em 0em;
  413. }
  414. .ui.top.right.pointing.dropdown .menu:after {
  415. top: @pointingArrowOffset;
  416. left: auto;
  417. right: @pointingArrowDistanceFromEdge;
  418. margin: 0em;
  419. transform: rotate(45deg);
  420. }
  421. .ui.left.pointing.dropdown .menu {
  422. top: 0%;
  423. left: 100%;
  424. right: auto;
  425. margin: 0em 0em 0em @pointingArrowDistanceFromEdge;
  426. }
  427. .ui.left.pointing.dropdown .menu:after {
  428. top: 1em;
  429. left: @pointingArrowOffset;
  430. margin: 0em 0em 0em 0em;
  431. transform: rotate(-45deg);
  432. }
  433. .ui.right.pointing.dropdown .menu {
  434. top: 0%;
  435. left: auto;
  436. right: 100%;
  437. margin: 0em @pointingArrowDistanceFromEdge 0em 0em;
  438. }
  439. .ui.right.pointing.dropdown .menu:after {
  440. top: 1em;
  441. left: auto;
  442. right: @pointingArrowOffset;
  443. margin: 0em 0em 0em 0em;
  444. transform: rotate(135deg);
  445. }
  446. .loadUIOverrides();