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.

538 lines
9.7 KiB

10 years ago
10 years ago
  1. /*
  2. * # Semantic - Dropdown
  3. * http://github.com/semantic-org/semantic-ui/
  4. *
  5. *
  6. * Copyright 2013 Contributors
  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: 1;
  25. transition:
  26. border-radius 0.1s ease,
  27. width 0.2s ease
  28. ;
  29. tap-highlight-color: rgba(0, 0, 0, 0);
  30. }
  31. /*******************************
  32. Content
  33. *******************************/
  34. /*--------------
  35. Menu
  36. ---------------*/
  37. .ui.dropdown .menu {
  38. cursor: auto;
  39. position: absolute;
  40. display: none;
  41. top: 100%;
  42. margin: 0em;
  43. background-color: #FFFFFF;
  44. min-width: 100%;
  45. white-space: nowrap;
  46. font-size: 0.875em;
  47. text-shadow: none;
  48. box-shadow: 0px 0px 1px 1px rgba(0, 0, 0, 0.1);
  49. border-radius: 0px 0px 0.325em 0.325em;
  50. transition: opacity 0.2s ease;
  51. z-index: 11;
  52. }
  53. /*--------------
  54. Icon
  55. ---------------*/
  56. .ui.dropdown > .dropdown.icon {
  57. width: auto;
  58. margin: 0em 0em 0em 1em;
  59. }
  60. .ui.dropdown > .dropdown.icon:before {
  61. content: "\f0d7";
  62. }
  63. .ui.dropdown .menu .item .dropdown.icon {
  64. width: auto;
  65. float: right;
  66. margin: 0em 0em 0em 0.5em;
  67. }
  68. .ui.dropdown .menu .item .dropdown.icon:before {
  69. content: "\f0da"/*rtl:"\f0d9"*/;
  70. }
  71. /*--------------
  72. Text
  73. ---------------*/
  74. .ui.dropdown > .text {
  75. display: inline-block;
  76. transition: color 0.2s ease;
  77. }
  78. /* Flyout Direction */
  79. .ui.dropdown .menu {
  80. left: 0px;
  81. }
  82. /*--------------
  83. Sub Menu
  84. ---------------*/
  85. .ui.dropdown .menu .menu {
  86. top: 0% !important;
  87. left: 100% !important;
  88. margin: 0em !important;
  89. border-radius: 0 0.325em 0.325em 0em !important;
  90. }
  91. .ui.dropdown .menu .menu:after {
  92. display: none;
  93. }
  94. .ui.dropdown .menu .item {
  95. cursor: pointer;
  96. border: none;
  97. height: auto;
  98. border-top: 1px solid rgba(0, 0, 0, 0.1);
  99. font-size: 0.875em;
  100. display: block;
  101. color: rgba(0, 0, 0, 0.75);
  102. padding: 0.85em 1em !important;
  103. font-size: 0.875rem;
  104. text-transform: none;
  105. font-weight: normal;
  106. text-align: left;
  107. -webkit-touch-callout: none;
  108. }
  109. .ui.dropdown .menu .item:before {
  110. display: none;
  111. }
  112. .ui.dropdown .menu .item .icon {
  113. margin-right: 0.75em;
  114. }
  115. .ui.dropdown .menu .item:first-child {
  116. border-top: none;
  117. }
  118. /*******************************
  119. Coupling
  120. *******************************/
  121. /* Opposite on last menu on right */
  122. .ui.menu .right.menu .dropdown:last-child .menu,
  123. .ui.buttons > .ui.dropdown:last-child .menu {
  124. left: auto;
  125. right: 0px;
  126. }
  127. .ui.vertical.menu .dropdown.item > .dropdown.icon:before {
  128. content: "\f0da"/*rtl:"\f0d9"*/;
  129. }
  130. .ui.dropdown.icon.button > .dropdown.icon {
  131. margin: 0em;
  132. }
  133. /*******************************
  134. States
  135. *******************************/
  136. /* Dropdown Visible */
  137. .ui.visible.dropdown > .menu {
  138. display: block;
  139. }
  140. /*--------------------
  141. Hover
  142. ----------------------*/
  143. /* Menu Item Hover */
  144. .ui.dropdown .menu .item:hover {
  145. background-color: rgba(0, 0, 0, 0.03);
  146. z-index: 12;
  147. }
  148. /*--------------------
  149. Active
  150. ----------------------*/
  151. /* Menu Item Active */
  152. .ui.dropdown .menu .active.item {
  153. box-shadow: none;
  154. font-weight: bold;
  155. border-left: none;
  156. background-color: rgba(0, 0, 0, 0.03);
  157. box-shadow: none;
  158. z-index: 12;
  159. }
  160. /*--------------------
  161. Default Text
  162. ----------------------*/
  163. .ui.dropdown > .default.text,
  164. .ui.default.dropdown > .text {
  165. color: rgba(179, 179, 179, 0.7);
  166. }
  167. .ui.dropdown:hover > .default.text,
  168. .ui.default.dropdown:hover > .text {
  169. color: rgba(140, 140, 140, 0.7);
  170. }
  171. /*--------------------
  172. Error
  173. ----------------------*/
  174. .ui.dropdown.error,
  175. .ui.dropdown.error > .text,
  176. .ui.dropdown.error > .default.text {
  177. color: #D95C5C !important;
  178. }
  179. .ui.selection.dropdown.error {
  180. background-color: #FFFAFA;
  181. box-shadow: 0px 0px 0px 1px rgba(231, 190, 190, 1) !important;
  182. }
  183. .ui.selection.dropdown.error:hover {
  184. box-shadow: 0px 0px 0px 1px rgba(231, 190, 190, 1) !important;
  185. }
  186. .ui.dropdown.error > .menu,
  187. .ui.dropdown.error > .menu .menu {
  188. box-shadow: 0px 0px 1px 1px #E7BEBE !important;
  189. }
  190. .ui.dropdown.error > .menu .item {
  191. color: #D95C5C !important;
  192. }
  193. /* Item Hover */
  194. .ui.dropdown.error > .menu .item:hover {
  195. background-color: #FFF2F2 !important;
  196. }
  197. /* Item Active */
  198. .ui.dropdown.error > .menu .active.item {
  199. background-color: #FDCFCF !important;
  200. }
  201. /*******************************
  202. Variations
  203. *******************************/
  204. /*--------------
  205. Simple
  206. ---------------*/
  207. /* Displays without javascript */
  208. .ui.simple.dropdown .menu:before,
  209. .ui.simple.dropdown .menu:after {
  210. display: none;
  211. }
  212. .ui.simple.dropdown .menu {
  213. display: block;
  214. overflow: hidden;
  215. top: -9999px !important;
  216. position: absolute;
  217. opacity: 0;
  218. width: 0;
  219. height: 0;
  220. transition: opacity 0.2s ease-out;
  221. }
  222. .ui.simple.active.dropdown,
  223. .ui.simple.dropdown:hover {
  224. border-bottom-left-radius: 0em !important;
  225. border-bottom-right-radius: 0em !important;
  226. }
  227. .ui.simple.active.dropdown > .menu,
  228. .ui.simple.dropdown:hover > .menu {
  229. overflow: visible;
  230. width: auto;
  231. height: auto;
  232. top: 100% !important;
  233. opacity: 1;
  234. }
  235. .ui.simple.dropdown > .menu .item:active > .menu,
  236. .ui.simple.dropdown:hover > .menu .item:hover > .menu {
  237. overflow: visible;
  238. width: auto;
  239. height: auto;
  240. top: 0% !important;
  241. left: 100% !important;
  242. opacity: 1;
  243. }
  244. .ui.simple.disabled.dropdown:hover .menu {
  245. display: none;
  246. height: 0px;
  247. width: 0px;
  248. overflow: hidden;
  249. }
  250. /*--------------
  251. Selection
  252. ---------------*/
  253. /* Displays like a select box */
  254. .ui.selection.dropdown {
  255. cursor: pointer;
  256. display: inline-block;
  257. word-wrap: break-word;
  258. white-space: normal;
  259. /* Matches selection dropdown height to input height */
  260. border-top: 1px solid transparent;
  261. background-color: #FFFFFF;
  262. padding: 0.65em 1em;
  263. line-height: 1.33;
  264. color: rgba(0, 0, 0, 0.8);
  265. box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.1) !important;
  266. border-radius: 0.3125em !important;
  267. }
  268. .ui.selection.dropdown select {
  269. display: none;
  270. }
  271. .ui.selection.dropdown > .dropdown.icon {
  272. opacity: 0.7;
  273. margin: 0.2em 0em 0.2em 1.25em;
  274. transition: opacity 0.2s ease-out;
  275. }
  276. .ui.selection.dropdown,
  277. .ui.selection.dropdown .menu {
  278. top: 100%;
  279. transition: box-shadow 0.2s ease-out;
  280. }
  281. .ui.selection.dropdown .menu {
  282. max-height: 312px;
  283. overflow-x: hidden;
  284. overflow-y: auto;
  285. box-shadow: 0px 1px 0px 1px #E0E0E0;
  286. border-radius: 0px 0px 0.325em 0.325em;
  287. }
  288. .ui.selection.dropdown .menu:after,
  289. .ui.selection.dropdown .menu:before {
  290. display: none;
  291. }
  292. .ui.selection.dropdown .menu img {
  293. height: 2.5em;
  294. display: inline-block;
  295. vertical-align: middle;
  296. margin-right: 0.5em;
  297. }
  298. /* Hover */
  299. .ui.selection.dropdown:hover {
  300. box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.2) !important;
  301. }
  302. .ui.selection.dropdown:hover .menu {
  303. box-shadow: 0px 1px 0px 1px #D3D3D3;
  304. }
  305. .ui.selection.dropdown:hover > .dropdown.icon {
  306. opacity: 1;
  307. }
  308. /* Visible */
  309. .ui.visible.selection.dropdown {
  310. border-bottom-left-radius: 0em !important;
  311. border-bottom-right-radius: 0em !important;
  312. }
  313. /* Active */
  314. .ui.active.selection.dropdown {
  315. border-radius: 0.3125em 0.3125em 0em 0em !important;
  316. }
  317. .ui.active.selection.dropdown > .dropdown.icon {
  318. opacity: 1;
  319. }
  320. /*--------------
  321. Fluid
  322. ---------------*/
  323. .ui.fluid.dropdown {
  324. display: block;
  325. }
  326. .ui.fluid.dropdown > .dropdown.icon {
  327. float: right;
  328. }
  329. /*--------------
  330. Inline
  331. ---------------*/
  332. .ui.inline.dropdown {
  333. cursor: pointer;
  334. display: inline-block;
  335. color: inherit;
  336. }
  337. .ui.inline.dropdown .dropdown.icon {
  338. margin: 0em 0.5em 0em 0.25em;
  339. }
  340. .ui.inline.dropdown .text {
  341. font-weight: bold;
  342. }
  343. .ui.inline.dropdown .menu {
  344. cursor: auto;
  345. margin-top: 0.25em;
  346. border-radius: 0.325em;
  347. }
  348. /*--------------
  349. Floating
  350. ---------------*/
  351. .ui.floating.dropdown .menu {
  352. left: 0;
  353. right: auto;
  354. margin-top: 0.5em !important;
  355. box-shadow:
  356. 0px 0px 0px 1px rgba(0, 0, 0, 0.2) inset,
  357. 0px 2px 5px 0px rgba(0, 0, 0, 0.15)
  358. ;
  359. border-radius: 0.325em;
  360. }
  361. /*--------------
  362. Pointing
  363. ---------------*/
  364. .ui.pointing.dropdown .menu {
  365. top: 100%;
  366. margin-top: 0.75em;
  367. border-radius: 0.325em;
  368. }
  369. .ui.pointing.dropdown .menu:after {
  370. display: block;
  371. position: absolute;
  372. pointer-events: none;
  373. content: " ";
  374. visibility: visible;
  375. width: 0.5em;
  376. height: 0.5em;
  377. box-shadow: -1px -1px 0px 1px rgba(0, 0, 0, 0.05);
  378. background-image: none;
  379. background-color: #FFFFFF;
  380. transform: rotate(45deg);
  381. z-index: 2;
  382. }
  383. .ui.pointing.dropdown .menu .active.item:first-child {
  384. background: transparent linear-gradient(transparent, rgba(0, 0, 0, 0.03));
  385. }
  386. /* Directions */
  387. .ui.pointing.dropdown .menu:after {
  388. top: -0.25em;
  389. left: 50%;
  390. margin: 0em 0em 0em -0.25em;
  391. }
  392. .ui.top.left.pointing.dropdown .menu {
  393. top: 100%;
  394. bottom: auto;
  395. left: 0%;
  396. right: auto;
  397. margin: 0.75em 0em 0em;
  398. }
  399. .ui.top.left.pointing.dropdown .menu:after {
  400. top: -0.25em;
  401. left: 1.25em;
  402. right: auto;
  403. margin: 0em;
  404. transform: rotate(45deg);
  405. }
  406. .ui.top.right.pointing.dropdown .menu {
  407. top: 100%;
  408. bottom: auto;
  409. right: 0%;
  410. left: auto;
  411. margin: 0.75em 0em 0em;
  412. }
  413. .ui.top.right.pointing.dropdown .menu:after {
  414. top: -0.25em;
  415. left: auto;
  416. right: 1.25em;
  417. margin: 0em;
  418. transform: rotate(45deg);
  419. }
  420. .ui.left.pointing.dropdown .menu {
  421. top: 0%;
  422. left: 100%;
  423. right: auto;
  424. margin: 0em 0em 0em 0.75em;
  425. }
  426. .ui.left.pointing.dropdown .menu:after {
  427. top: 1em;
  428. left: -0.25em;
  429. margin: 0em 0em 0em 0em;
  430. transform: rotate(-45deg);
  431. }
  432. .ui.right.pointing.dropdown .menu {
  433. top: 0%;
  434. left: auto;
  435. right: 100%;
  436. margin: 0em 0.75em 0em 0em;
  437. }
  438. .ui.right.pointing.dropdown .menu:after {
  439. top: 1em;
  440. left: auto;
  441. right: -0.25em;
  442. margin: 0em 0em 0em 0em;
  443. transform: rotate(135deg);
  444. }
  445. .loadUIOverrides();