dropdown.scss 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  1. @import "vars";
  2. @import "mixins";
  3. $delay: 0.05;
  4. $predelay: 0;
  5. .open .contained-dropdown.open {pointer-events: auto; }
  6. .contained-dropdown {
  7. //position: absolute;
  8. top: 0px;
  9. bottom: 0px;
  10. left: 0;
  11. right: 0;
  12. width: 100%;
  13. pointer-events: none;
  14. z-index: 200;
  15. @include transition( all 0.1s ease-in-out);
  16. border-bottom-left-radius: 10px;
  17. border-bottom-right-radius: 10px;
  18. // border-radius: 10px;
  19. > * {
  20. opacity: 0;
  21. @include transition( all 0.1s ease-in-out);
  22. }
  23. .overflow-y-scroll {
  24. top: 0;
  25. bottom: 0;
  26. left: 0;
  27. right: 0;
  28. height: auto;
  29. width: auto;
  30. @include translateY (1%);
  31. ul li span {
  32. text-align: center;
  33. font-size: $font-size;
  34. line-height: $line-height;
  35. }
  36. }
  37. &.hover:hover,
  38. &.open {
  39. // &:before {opacity: 0.125; }
  40. // pointer-events: auto;
  41. background-color: $dark;
  42. background-color: $light;
  43. > * {
  44. opacity: 1;
  45. }
  46. }
  47. }
  48. .form-list {
  49. padding: 0px;
  50. margin: 0px;
  51. > li {
  52. list-style: none;
  53. color: $medium;;
  54. position: relative;
  55. .dropdown {
  56. position: static;
  57. z-index: initial;
  58. }
  59. > div {border-bottom: 2px solid rgba(255,255,255,0.025); }
  60. &:hover {color: $light; }
  61. }
  62. label {
  63. float: left;
  64. font-size: 12px;
  65. min-width: 0px;
  66. position: absolute;
  67. line-height: 60px;
  68. height: 60px;
  69. padding-left: 20px;
  70. }
  71. }
  72. .dropdown-menu .section {
  73. border-top: 2px solid rgba(0,0,0,0.2);
  74. padding: 15px;
  75. text-align: center;
  76. &:last-child {padding-bottom: 15px; }
  77. }
  78. .btn + .dropdown-group,
  79. .dropdown + .dropdown-group,
  80. .btn-divider + .dropdown-group {
  81. > .dropdown {
  82. > .btn{border-radius: 0px !important; }
  83. }
  84. }
  85. .dropdown-group {
  86. display: inline-block;
  87. vertical-align: middle;
  88. position: relative;
  89. > .dropdown {
  90. position: static;
  91. z-index: initial;
  92. > .btn{border-radius: 0px; }
  93. &:first-child > .btn{
  94. border-top-left-radius: $radius;
  95. border-bottom-left-radius: $radius;
  96. }
  97. &:last-child > .btn{
  98. border-top-right-radius: $radius ;
  99. border-bottom-right-radius: $radius ;
  100. }
  101. }
  102. }
  103. .dropdown {
  104. display: inline-block;
  105. position: relative;
  106. vertical-align: middle;
  107. &.dropdown-block {
  108. display: block;
  109. .dropdown-toggle {
  110. width: 100%;
  111. display: block;
  112. text-align: left;
  113. }
  114. .dropdown-menu {
  115. min-width: 100%;
  116. min-width: 150px;
  117. }
  118. }
  119. &.dark > .dropdown-menu,
  120. &.dark > .dialog {
  121. background: $dark;
  122. color: $medium;
  123. }
  124. &.light > .dropdown-menu,
  125. &.light > .dialog {
  126. background: $light;
  127. color: $medium;
  128. }
  129. > .dropdown-menu {
  130. box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.05), 0 2px 7px rgba(0, 0, 0, 0.1);
  131. @include backface-visibility(hidden);
  132. z-index: 1000;
  133. white-space: nowrap;
  134. position: absolute;
  135. top: 100%;
  136. left: 50%;
  137. margin-top: 8px;
  138. @include opacity(0);
  139. @include user-select(none);
  140. @include transition( all 0.125s ease-in-out);
  141. pointer-events: none;
  142. border-radius: $radius;
  143. > ul,
  144. > div {
  145. position: relative !important;
  146. // background-color: $dark !important;
  147. // color: $light;
  148. &.center { text-align: center; }
  149. &.overflow-y-scroll { max-height: 250px; }
  150. > li {
  151. &:hover {
  152. > a,
  153. > span {
  154. background-color: rgba(255,255,255,0.05);
  155. }
  156. }
  157. > a,
  158. > span {
  159. &:before {
  160. background-color: white;
  161. }
  162. }
  163. }
  164. }
  165. }
  166. &.hover:hover > .dialog,
  167. &.hover:hover > .dropdown-menu,
  168. &.open > .dialog,
  169. &.open > .dropdown-menu {
  170. @include opacity(1);
  171. pointer-events: auto !important;
  172. display: block;
  173. }
  174. &.center {
  175. &.hover:hover,
  176. &.open {
  177. > .dialog,
  178. > .dropdown-menu {
  179. -webkit-transform: translate3d(-50%, -50%, 100px) scale(1);
  180. -ms-transform: translate3d(-50%, -50%, 100px) scale(1);
  181. transform: translate3d(-50%, -50%, 100px) scale(1);
  182. }
  183. }
  184. > .dialog,
  185. > .dropdown-menu {
  186. left: 50%;
  187. top: 50%;
  188. margin-top: 0px;
  189. @include transform-origin(center center);
  190. -webkit-transform: translate3d(-50%, -50%, 100px) scale(0.93,0.8);
  191. -ms-transform: translate3d(-50%, -50%, 100px) scale(0.93,0.8);
  192. transform: translate3d(-50%, -50%, 100px) scale(0.93,0.8);
  193. }
  194. }
  195. &.bottomleft {
  196. > .dialog,
  197. > .dropdown-menu {
  198. top: auto;
  199. bottom: 100%;
  200. margin-bottom: 16px;
  201. @include transform-origin(bottom left);
  202. -webkit-transform: translate3d(-33%, 0%, 100px) scale(0.93,0.8);
  203. -ms-transform: translate3d(-33%, 0%, 100px) scale(0.93,0.8);
  204. transform: translate3d(-33%, 0%, 100px) scale(0.93,0.8);
  205. }
  206. }
  207. &.bottom {
  208. > .dialog,
  209. > .dropdown-menu {
  210. top: auto;
  211. bottom: 100%;
  212. margin-bottom: 16px;
  213. @include transform-origin(bottom center);
  214. -webkit-transform: translate3d(-50%, 0%, 100px) scale(0.93,0.8);
  215. -ms-transform: translate3d(-50%, 0%, 100px) scale(0.93,0.8);
  216. transform: translate3d(-50%, 0%, 100px) scale(0.93,0.8);
  217. }
  218. }
  219. &.top {
  220. > .dialog,
  221. > .dropdown-menu {
  222. top: 100%;
  223. bottom: auto;
  224. margin-top: -16px;
  225. @include transform-origin(top center);
  226. -webkit-transform: translate3d(-50%, 0%, 100px) scale(0.93,0.8);
  227. -ms-transform: translate3d(-50%, 0%, 100px) scale(0.93,0.8);
  228. transform: translate3d(-50%, 0%, 100px) scale(0.93,0.8);
  229. }
  230. }
  231. &.top.right {
  232. > .dialog,
  233. > .dropdown-menu {
  234. top: 100%;
  235. bottom: auto;
  236. left: auto;
  237. right: 0;
  238. margin-top: 16px;
  239. @include transform-origin(top right);
  240. -webkit-transform: translate3d(0%, 0%, 100px) scale(0.93,0.8);
  241. -ms-transform: translate3d(0%, 0%, 100px) scale(0.93,0.8);
  242. transform: translate3d(0%, 0%, 100px) scale(0.93,0.8);
  243. }
  244. &.hover:hover,
  245. &.open {
  246. > .dialog,
  247. > .dropdown-menu {
  248. -webkit-transform: translate3d(0%, 0%, 100px) scale(1);
  249. -ms-transform: translate3d(0%, 0%, 100px) scale(1);
  250. transform: translate3d(0%, 0%, 100px) scale(1);
  251. }
  252. }
  253. }
  254. &.top,
  255. &.bottom,
  256. &.bottomleft {
  257. /*&.open > .btn-group > .btn-icon-labeled:hover,
  258. &.open > .btn-icon-labeled:hover {
  259. .icon-label {opacity: 0; margin: 0; }
  260. .icon:before {line-height: 60px; }
  261. }*/
  262. &.hover:hover,
  263. &.open {
  264. > .btn-dark,
  265. > .btn-group > .btn-dark {
  266. .jewel {
  267. background-color: #fff !important;
  268. border-color: #303030 !important;
  269. }
  270. }
  271. > .dialog,
  272. > .dropdown-menu {
  273. -webkit-transform: translate3d(-50%, 0%, 100px) scale(1);
  274. -ms-transform: translate3d(-50%, 0%, 100px) scale(1);
  275. transform: translate3d(-50%, 0%, 100px) scale(1);
  276. }
  277. }
  278. }
  279. &.bottomleft {
  280. &.hover:hover,
  281. &.open {
  282. > .dialog,
  283. > .dropdown-menu {
  284. -webkit-transform: translate3d(-33%, 0%, 100px) scale(1) !important;
  285. -ms-transform: translate3d(-33%, 0%, 100px) scale(1) !important;
  286. transform: translate3d(-33%, 0%, 100px) scale(1) !important;
  287. }
  288. }
  289. }
  290. }
  291. .dropdown {
  292. &.options-3 {
  293. &.option-1:after { margin-left: -68px;}
  294. &.option-2:after { margin-left: -8px;}
  295. &.option-3:after { margin-left: 52px;}
  296. }
  297. &.option-1:after { margin-left: -38px;}
  298. &.option-2:after { margin-left: 22px;}
  299. &.open:after {
  300. @include transition( all 0.1s ease-in-out 0s);
  301. -webkit-transform: scale(1);
  302. -ms-transform: scale(1);
  303. transform: scale(1);
  304. }
  305. &:after {
  306. @include transition( all 0.1s ease-in-out 0s);
  307. content: "";
  308. position: absolute;
  309. bottom: 100%;
  310. width: 0;
  311. height: 0;
  312. // margin-bottom: 8px;
  313. margin-left: -8px;
  314. pointer-events: none !important;
  315. left: 50%;
  316. -webkit-transform: scale(0,0);
  317. -ms-transform: scale(0,0);
  318. transform: scale(0,0);
  319. }
  320. &.bottom:after, &.bottomleft:after {
  321. @include transform-origin(bottom center);
  322. bottom: 100%;
  323. border-bottom: 8px solid transparent;
  324. border-right: 8px solid transparent;
  325. border-top: 8px solid #303030;
  326. border-left: 8px solid transparent;
  327. }
  328. &.top:after {
  329. @include transform-origin(top center);
  330. top: 100%;
  331. border-bottom: 8px solid #303030;
  332. border-right: 8px solid transparent;
  333. border-top: 8px solid transparent;
  334. border-left: 8px solid transparent;
  335. }
  336. }