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.

534 lines
10 KiB

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