_menu.scss 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. .menu {
  2. position: -webkit-sticky;
  3. position: sticky;
  4. top: $grid-nav-height;
  5. padding: 0.5rem;
  6. margin: 0.5rem;
  7. margin-top: 0;
  8. padding-top: 0.85rem;
  9. height: calc(100vh - $grid-nav-height);
  10. overflow-y: auto;
  11. z-index: z('menu');
  12. @media only screen and (max-width: 600px) {
  13. top: 0;
  14. }
  15. &__label {
  16. font-family: $title-font;
  17. font-size: 1rem;
  18. margin: 0.65rem 0;
  19. padding-bottom: 0.5rem;
  20. text-transform: capitalize;
  21. @include themify($themes) {
  22. color: themed('toc-label-color');
  23. }
  24. @media only screen and (max-width: 600px) {
  25. text-align: center;
  26. font-size: 1.125rem;
  27. }
  28. }
  29. &__title {
  30. cursor: pointer;
  31. position: relative;
  32. word-break: break-word;
  33. font-size: 0.925rem;
  34. height: $menu-title-height;
  35. margin: 0.25rem 0;
  36. &[data-depth="1"] {
  37. font-size: 0.925rem;
  38. margin-left: 1.25rem;
  39. }
  40. &[data-depth="2"] {
  41. font-size: 0.925rem;
  42. margin-left: 2.5rem;
  43. }
  44. &[data-depth="3"] {
  45. font-size: 0.925rem;
  46. margin-left: 3.75rem;
  47. }
  48. &[data-depth="4"] {
  49. font-size: 0.925rem;
  50. margin-left: 5rem;
  51. }
  52. @include no-select;
  53. @include flexbox();
  54. @include align-items(center);
  55. @include themify($themes) {
  56. color: themed('body-color');
  57. @include on-event {
  58. color: themed('no-active-font-color');
  59. }
  60. &.active {
  61. font-weight: bold;
  62. color: themed('active-font-color');
  63. }
  64. }
  65. &--collapse {
  66. cursor: pointer;
  67. word-break: break-word;
  68. font-size: 16px;
  69. height: $menu-title-height;
  70. margin: 0.25rem 0;
  71. &[data-depth="1"] {
  72. font-size: 0.925rem;
  73. margin-left: 1.25rem;
  74. }
  75. &[data-depth="2"] {
  76. font-size: 0.925rem;
  77. margin-left: 2.5rem;
  78. }
  79. &[data-depth="3"] {
  80. font-size: 0.925rem;
  81. margin-left: 3.75rem;
  82. }
  83. &[data-depth="4"] {
  84. font-size: 0.925rem;
  85. margin-left: 5rem;
  86. }
  87. @include no-select;
  88. @include flexbox();
  89. @include align-items(center);
  90. @include themify($themes) {
  91. color: themed('body-color');
  92. &.active {
  93. svg {
  94. color: themed('active-font-color');
  95. }
  96. }
  97. }
  98. @include on-event {
  99. @include themify($themes) {
  100. color: themed('link-hover');
  101. svg {
  102. color: themed('link-hover');
  103. @include translateX(0.125rem);
  104. }
  105. }
  106. }
  107. }
  108. &--icon {
  109. margin-top: 2px;
  110. @include themify($themes) {
  111. color: themed('menu-arrow-color');
  112. }
  113. &.down {
  114. @include rotate(90);
  115. @include transition(all, 0.15s, ease);
  116. }
  117. &.downrtl {
  118. @include rotate(-90);
  119. @include transition(all, 0.15s, ease);
  120. }
  121. &.right {
  122. @include rotate(0);
  123. @include transition(all, 0.15s, ease);
  124. }
  125. svg {
  126. display: block;
  127. margin: auto 0;
  128. @include transition(all, 0.15s, ease);
  129. }
  130. }
  131. }
  132. &__alone {
  133. cursor: pointer;
  134. @include no-select;
  135. }
  136. &__list {
  137. max-height: 0;
  138. overflow: hidden;
  139. word-wrap: break-word;
  140. @include transition();
  141. li {
  142. margin-left: 1.25rem;
  143. &.active {
  144. font-weight: bold;
  145. }
  146. }
  147. }
  148. .active {
  149. max-height: 100%;
  150. }
  151. li.active {
  152. @include themify($themes) {
  153. a {
  154. font-weight: bold;
  155. }
  156. }
  157. }
  158. }