SubMenuItem.scss 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. .sidebar-sub-menu-trigger-icon {
  2. display: block;
  3. width: 20px;
  4. height: 20px;
  5. position: absolute;
  6. // Remove once we drop support for Safari 13.
  7. // stylelint-disable-next-line property-disallowed-list
  8. right: 15px;
  9. inset-inline-end: 15px;
  10. top: 0;
  11. bottom: 0;
  12. margin: auto 0;
  13. @include transition(
  14. transform $menu-transition-duration ease,
  15. width $menu-transition-duration ease,
  16. height $menu-transition-duration ease
  17. );
  18. &--open {
  19. transform-origin: 50% 50%;
  20. transform: rotate(180deg);
  21. }
  22. .sidebar--slim & {
  23. width: 16px;
  24. height: 16px;
  25. transform: translate3d(13px, 0, 0);
  26. }
  27. }
  28. .sidebar-sub-menu-panel {
  29. @apply w-flex w-flex-col w-bg-primary-200 w-h-screen;
  30. width: $menu-width;
  31. > h2,
  32. &__list {
  33. width: $menu-width;
  34. }
  35. > h2 {
  36. // w-min-h-[160px] and w-mt-[35px] classes are to vertically align the title and icon combination to the search input on the left
  37. @apply w-min-h-[160px] w-mt-[35px] w-text-white w-mb-0 w-inline-flex w-flex-col w-justify-center w-items-center;
  38. &:before {
  39. font-size: 4em;
  40. display: block;
  41. text-align: center;
  42. margin: 0 0 0.2em;
  43. width: 100%;
  44. opacity: 0.15;
  45. }
  46. }
  47. ul > li {
  48. position: relative;
  49. @include transition(border-color $menu-transition-duration ease);
  50. }
  51. > ul {
  52. flex-grow: 1;
  53. padding: 0;
  54. margin: 0;
  55. overflow-y: auto;
  56. }
  57. > ul > li {
  58. border: 0;
  59. }
  60. &__footer {
  61. margin: 0;
  62. padding: 0.9em 1.7em;
  63. text-align: center;
  64. color: $color-menu-text;
  65. }
  66. &--visible {
  67. visibility: visible;
  68. box-shadow: 2px 0 2px rgba(0, 0, 0, 0.35);
  69. }
  70. @at-root .sidebar--slim #{&} {
  71. transform: translate3d($menu-width-slim - $menu-width, 0, 0);
  72. }
  73. // Don't apply this to nested submenus though
  74. @at-root .sidebar--slim .sidebar-sub-menu-panel #{&} {
  75. transform: translate3d(0, 0, 0);
  76. }
  77. &--open {
  78. transform: translate3d($menu-width, 0, 0);
  79. // If another submenu is opening, display this menu behind it
  80. z-index: -1;
  81. @at-root .sidebar--slim #{&} {
  82. transform: translate3d($menu-width-slim, 0, 0);
  83. }
  84. // Don't apply this to nested submenus though
  85. @at-root .sidebar--slim .sidebar-sub-menu-panel #{&} {
  86. transform: translate3d($menu-width, 0, 0);
  87. }
  88. }
  89. }
  90. .sidebar-sub-menu-item {
  91. &--open {
  92. > a {
  93. text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.3);
  94. }
  95. }
  96. }