_menu.scss 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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. &__label {
  13. font-family: $title-font;
  14. font-size: 1rem;
  15. margin: 0.65rem 0;
  16. padding-bottom: 0.5rem;
  17. text-transform: capitalize;
  18. @include themify($themes) {
  19. color: themed('toc-label-color');
  20. }
  21. @media only screen and (max-width: 600px) {
  22. text-align: center;
  23. font-size: 1.125rem;
  24. }
  25. }
  26. &__title {
  27. cursor: pointer;
  28. position: relative;
  29. word-break: break-word;
  30. font-size: 0.925rem;
  31. height: $menu-title-height;
  32. margin: 0.25rem 0;
  33. @include no-select;
  34. @include flexbox();
  35. @include align-items(center);
  36. @include themify($themes) {
  37. color: themed('body-color');
  38. @include on-event {
  39. color: themed('no-active-font-color');
  40. }
  41. &.active {
  42. font-weight: bold;
  43. color: themed('active-font-color');
  44. }
  45. }
  46. &--collapse {
  47. cursor: pointer;
  48. word-break: break-word;
  49. font-size: 16px;
  50. height: $menu-title-height;
  51. margin: 0.25rem 0;
  52. @include no-select;
  53. @include flexbox();
  54. @include align-items(center);
  55. @include themify($themes) {
  56. color: themed('body-color');
  57. &.active {
  58. font-weight: bold;
  59. color: themed('active-font-color');
  60. svg {
  61. color: themed('active-font-color');
  62. }
  63. }
  64. }
  65. @include on-event {
  66. @include themify($themes) {
  67. color: themed('link-hover');
  68. svg {
  69. color: themed('link-hover');
  70. @include translateX(0.125rem);
  71. }
  72. }
  73. }
  74. }
  75. &--icon {
  76. margin-top: 2px;
  77. @include themify($themes) {
  78. color: themed('menu-arrow-color');
  79. }
  80. &.down {
  81. @include rotate(90);
  82. @include transition(all, 0.15s, ease);
  83. }
  84. &.right {
  85. @include rotate(0);
  86. @include transition(all, 0.15s, ease);
  87. }
  88. svg {
  89. display: block;
  90. margin: auto 0;
  91. @include transition(all, 0.15s, ease);
  92. }
  93. }
  94. }
  95. &__alone {
  96. cursor: pointer;
  97. @include no-select;
  98. }
  99. &__list {
  100. max-height: 0;
  101. overflow: hidden;
  102. word-wrap: break-word;
  103. @include transition();
  104. .active {
  105. font-weight: bold;
  106. }
  107. li {
  108. margin-left: 1.25rem;
  109. &.active {
  110. font-weight: bold;
  111. }
  112. }
  113. }
  114. .active {
  115. max-height: 100%;
  116. }
  117. li.active {
  118. @include themify($themes) {
  119. a {
  120. font-weight: bold;
  121. }
  122. }
  123. }
  124. }