_menu.scss 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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. margin-left: 1.25rem;
  37. }
  38. &[data-depth="2"] {
  39. margin-left: 2rem;
  40. }
  41. &[data-depth="3"] {
  42. margin-left: 2.75rem;
  43. }
  44. &[data-depth="4"] {
  45. margin-left: 3.5rem;
  46. }
  47. @include no-select;
  48. @include flexbox();
  49. @include align-items(center);
  50. @include themify($themes) {
  51. color: themed('body-color');
  52. @include on-event {
  53. color: themed('no-active-font-color');
  54. }
  55. &.active {
  56. font-weight: bold;
  57. color: themed('active-font-color');
  58. }
  59. }
  60. &--collapse {
  61. cursor: pointer;
  62. word-break: break-word;
  63. font-size: 0.925rem;
  64. height: $menu-title-height;
  65. margin: 0.25rem 0;
  66. &[data-depth="1"] {
  67. margin-left: 1.25rem;
  68. }
  69. &[data-depth="2"] {
  70. margin-left: 2rem;
  71. }
  72. &[data-depth="3"] {
  73. margin-left: 2.75rem;
  74. }
  75. &[data-depth="4"] {
  76. margin-left: 3.5rem;
  77. }
  78. @include no-select;
  79. @include flexbox();
  80. @include align-items(center);
  81. @include themify($themes) {
  82. color: themed('body-color');
  83. &.active {
  84. svg {
  85. color: themed('active-font-color');
  86. }
  87. }
  88. }
  89. @include on-event {
  90. @include themify($themes) {
  91. color: themed('link-hover');
  92. svg {
  93. color: themed('link-hover');
  94. @include translateX(0.125rem);
  95. }
  96. }
  97. }
  98. & > span {
  99. @include truncate(150px);
  100. }
  101. }
  102. &--icon {
  103. margin-top: 2px;
  104. @include themify($themes) {
  105. color: themed('menu-arrow-color');
  106. }
  107. &.down {
  108. @include rotate(90);
  109. @include transition(all, 0.15s, ease);
  110. }
  111. &.downrtl {
  112. @include rotate(-90);
  113. @include transition(all, 0.15s, ease);
  114. }
  115. &.right {
  116. @include rotate(0);
  117. @include transition(all, 0.15s, ease);
  118. }
  119. svg {
  120. display: block;
  121. margin: auto 0;
  122. @include transition(all, 0.15s, ease);
  123. }
  124. }
  125. }
  126. &__alone {
  127. cursor: pointer;
  128. @include no-select;
  129. }
  130. &__list {
  131. max-height: 0;
  132. overflow: hidden;
  133. word-wrap: break-word;
  134. @include transition();
  135. li {
  136. margin: 0.75rem 0 0.75rem 1.25rem;
  137. @include truncate(170px);
  138. &.active {
  139. font-weight: bold;
  140. }
  141. a {
  142. display: inline;
  143. }
  144. }
  145. li.menu__title--collapse {
  146. margin: 0.25rem 0 0.25rem 1.25rem;
  147. &[data-depth="1"] {
  148. margin-left: 1.25rem;
  149. }
  150. &[data-depth="2"] {
  151. margin-left: 2rem;
  152. }
  153. &[data-depth="3"] {
  154. margin-left: 2.75rem;
  155. }
  156. &[data-depth="4"] {
  157. margin-left: 3.5rem;
  158. }
  159. }
  160. }
  161. .active {
  162. max-height: 100%;
  163. }
  164. li.active {
  165. @include themify($themes) {
  166. a {
  167. font-weight: bold;
  168. }
  169. }
  170. }
  171. }