No Description
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.

_navbar-dropdown.scss 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. // Dropdown menu
  2. @include media-breakpoint-up(md) {
  3. .navbar {
  4. .dropdown-menu {
  5. opacity: 0;
  6. pointer-events: none;
  7. margin: 0;
  8. }
  9. .dropdown-menu-arrow {
  10. &:before {
  11. background: $dropdown-bg;
  12. box-shadow: none;
  13. content: '';
  14. display: block;
  15. height: 12px;
  16. width: 12px;
  17. left: 20px;
  18. position: absolute;
  19. bottom: 100%;
  20. transform: rotate(-45deg) translateY(12px);
  21. z-index: -5;
  22. border-radius: 2px;
  23. }
  24. }
  25. .dropdown-menu-right {
  26. &:before {
  27. right: 20px;
  28. left: auto;
  29. }
  30. }
  31. &:not(.navbar-nav-hover) {
  32. .dropdown-menu {
  33. &.show {
  34. opacity: 1;
  35. pointer-events: auto;
  36. animation: show-navbar-dropdown .25s ease forwards;
  37. }
  38. &.close {
  39. display: block;
  40. animation: hide-navbar-dropdown .15s ease backwards;
  41. }
  42. }
  43. }
  44. &.navbar-nav-hover {
  45. .dropdown-menu {
  46. opacity: 0;
  47. display: block;
  48. pointer-events: none;
  49. transform: translate(0, 10px) perspective(200px) rotateX(-2deg);
  50. transition: visibility 0.25s, opacity 0.25s, transform 0.25s;
  51. }
  52. .nav-item.dropdown:hover > .dropdown-menu {
  53. display: block;
  54. opacity: 1;
  55. pointer-events: auto;
  56. visibility: visible;
  57. transform: translate(0, 0);
  58. animation: none;
  59. }
  60. }
  61. .dropdown-menu-inner {
  62. position: relative;
  63. padding: 1rem;
  64. }
  65. // Keyframes
  66. @keyframes show-navbar-dropdown {
  67. 0% {
  68. opacity: 0;
  69. transform: translate(0, 10px) perspective(200px) rotateX(-2deg);
  70. transition: visibility 0.25s, opacity 0.25s, transform 0.25s;
  71. }
  72. 100% {
  73. transform: translate(0, 0);
  74. opacity: 1;
  75. }
  76. }
  77. @keyframes hide-navbar-dropdown {
  78. from {
  79. opacity: 1;
  80. }
  81. to {
  82. opacity: 0;
  83. transform: translate(0, 10px);
  84. }
  85. }
  86. }
  87. }