_dropdown.scss 4.6 KB

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