_dropdown.scss 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. //
  2. // Component: Dropdown
  3. //
  4. // General Dropdown Rules
  5. //.dropdown-item {
  6. // &:first-of-type {
  7. // @include border-top-radius($border-radius);
  8. // }
  9. // &:last-of-type {
  10. // @include border-bottom-radius($border-radius);
  11. // }
  12. //}
  13. .dropdown-item-title {
  14. font-size: $font-size-base;
  15. margin: 0;
  16. }
  17. // Dropdown Sizes
  18. .dropdown-menu-lg {
  19. max-width: 300px;
  20. min-width: 280px;
  21. padding: 0;
  22. .dropdown-divider {
  23. margin: 0;
  24. }
  25. .dropdown-item {
  26. padding: $dropdown-padding-y $dropdown-item-padding-x;
  27. }
  28. p {
  29. margin: 0;
  30. white-space: normal;
  31. }
  32. }
  33. // Dropdown Submenu
  34. .dropdown-submenu {
  35. position: relative;
  36. & > a:after {
  37. @include caret-right;
  38. float: right;
  39. margin-left: .5rem;
  40. margin-top: .5rem;
  41. }
  42. & > .dropdown-menu {
  43. left: 100%;
  44. margin-left: 0px;
  45. margin-top: 0px;
  46. top: 0;
  47. }
  48. }
  49. // Dropdown Hover
  50. .dropdown-hover {
  51. &:hover,
  52. &.nav-item.dropdown:hover,
  53. .dropdown-submenu:hover,
  54. &.dropdown-submenu:hover {
  55. > .dropdown-menu {
  56. display: block;
  57. }
  58. }
  59. }
  60. // Dropdown Sizes
  61. .dropdown-menu-xl {
  62. max-width: 420px;
  63. min-width: 360px;
  64. padding: 0;
  65. .dropdown-divider {
  66. margin: 0;
  67. }
  68. .dropdown-item {
  69. padding: $dropdown-padding-y $dropdown-item-padding-x;
  70. }
  71. p {
  72. margin: 0;
  73. white-space: normal;
  74. }
  75. }
  76. // Dropdown header and footer
  77. .dropdown-footer,
  78. .dropdown-header {
  79. display: block;
  80. font-size: $font-size-sm;
  81. padding: .5rem $dropdown-item-padding-x;
  82. text-align: center;
  83. }
  84. // Add fade animation to dropdown menus by appending
  85. // the class .animated-dropdown-menu to the .dropdown-menu ul (or ol)
  86. .open:not(.dropup) > .animated-dropdown-menu {
  87. @include animation(flipInX .7s both);
  88. backface-visibility: visible !important;
  89. }
  90. @keyframes flipInX {
  91. 0% {
  92. transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
  93. transition-timing-function: ease-in;
  94. opacity: 0;
  95. }
  96. 40% {
  97. transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
  98. transition-timing-function: ease-in;
  99. }
  100. 60% {
  101. transform: perspective(400px) rotate3d(1, 0, 0, 10deg);
  102. opacity: 1;
  103. }
  104. 80% {
  105. transform: perspective(400px) rotate3d(1, 0, 0, -5deg);
  106. }
  107. 100% {
  108. transform: perspective(400px);
  109. }
  110. }
  111. // Fix dropdown menu in navbars
  112. .navbar-custom-menu > .navbar-nav {
  113. > li {
  114. position: relative;
  115. > .dropdown-menu {
  116. position: absolute;
  117. right: 0;
  118. left: auto;
  119. }
  120. }
  121. }
  122. @include media-breakpoint-down(sm) {
  123. .navbar-custom-menu > .navbar-nav {
  124. float: right;
  125. > li {
  126. position: static;
  127. > .dropdown-menu {
  128. position: absolute;
  129. right: 5%;
  130. left: auto;
  131. border: 1px solid #ddd;
  132. background: $white;
  133. }
  134. }
  135. }
  136. }
  137. // User Menu
  138. .navbar-nav > .user-menu {
  139. > .nav-link:after {
  140. content:none;
  141. }
  142. > .dropdown-menu {
  143. @include border-top-radius(0);
  144. padding: 0;
  145. border-top-width: 0;
  146. width: 280px;
  147. &,
  148. > .user-body {
  149. @include border-bottom-radius(4px);
  150. }
  151. // Header menu
  152. > li.user-header {
  153. height: 175px;
  154. padding: 10px;
  155. text-align: center;
  156. // User image
  157. > img {
  158. z-index: 5;
  159. height: 90px;
  160. width: 90px;
  161. border: 3px solid;
  162. border-color: transparent;
  163. border-color: rgba(255, 255, 255, 0.2);
  164. }
  165. > p {
  166. z-index: 5;
  167. font-size: 17px;
  168. //text-shadow: 2px 2px 3px #333333;
  169. margin-top: 10px;
  170. > small {
  171. display: block;
  172. font-size: 12px;
  173. }
  174. }
  175. }
  176. // Menu Body
  177. > .user-body {
  178. @include clearfix;
  179. border-bottom: 1px solid $gray-700;
  180. border-top: 1px solid $gray-300;
  181. padding: 15px;
  182. a {
  183. @include media-breakpoint-up(sm) {
  184. background: $white !important;
  185. color: $gray-700 !important;
  186. }
  187. }
  188. }
  189. // Menu Footer
  190. > .user-footer {
  191. @include clearfix;
  192. background-color: $gray-100;
  193. padding: 10px;
  194. .btn-default {
  195. color: $gray-600;
  196. &:hover {
  197. @include media-breakpoint-up(sm) {
  198. background-color: $gray-100;
  199. }
  200. }
  201. }
  202. }
  203. }
  204. .user-image {
  205. @include media-breakpoint-up(sm) {
  206. float: none;
  207. line-height: 10px;
  208. margin-right: 0;
  209. margin-top: -8px;
  210. }
  211. border-radius: 50%;
  212. float: left;
  213. height: 25px;
  214. margin-right: 10px;
  215. margin-top: -2px;
  216. width: 25px;
  217. }
  218. }