_menu.scss 3.4 KB

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