_sidebar-tree.scss 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. //
  2. // Left side navigation
  3. //
  4. .td-sidebar-nav {
  5. $_max-height: calc(100vh - 8.5rem);
  6. padding-right: 0.5rem;
  7. margin-right: -15px;
  8. margin-left: -15px;
  9. @include media-breakpoint-up(md) {
  10. @supports (position: sticky) {
  11. max-height: $_max-height;
  12. overflow-y: auto;
  13. }
  14. }
  15. // Adjust height and padding when sidebar_search_disable is true, but only for
  16. // >= `lg` views, because on tablet (`md`) and mobile (<= `sm`), the search
  17. // box is displayed regardless of the value of sidebar_search_disable:
  18. &.td-sidebar-nav--search-disabled {
  19. @include media-breakpoint-up(lg) {
  20. // There's no search box so add top padding
  21. // and adjust max-height:
  22. padding-top: 1rem;
  23. @supports (position: sticky) {
  24. max-height: calc(#{$_max-height} + 4.5rem);
  25. }
  26. }
  27. }
  28. @include media-breakpoint-up(md) {
  29. display: block !important;
  30. }
  31. &__section {
  32. li {
  33. list-style: none;
  34. }
  35. &.ul-0,
  36. ul {
  37. padding: 0;
  38. margin: 0;
  39. }
  40. @include media-breakpoint-up(md) {
  41. & .ul-1 ul {
  42. padding-left: 1.5em;
  43. }
  44. }
  45. padding-left: 0;
  46. }
  47. &__section-title {
  48. display: block;
  49. font-weight: $font-weight-medium;
  50. .active {
  51. font-weight: $font-weight-bold;
  52. }
  53. a {
  54. color: var(--bs-secondary-color);
  55. }
  56. }
  57. .td-sidebar-link {
  58. display: block;
  59. padding-bottom: 0.375rem;
  60. &__page {
  61. color: var(--bs-body-color);
  62. font-weight: $font-weight-light;
  63. }
  64. }
  65. a {
  66. &:focus,
  67. &:hover {
  68. color: var(--bs-link-color);
  69. }
  70. &.active {
  71. font-weight: $font-weight-bold;
  72. }
  73. }
  74. .dropdown .nav-link {
  75. padding-left: 1.5rem;
  76. margin-bottom: 0.5rem;
  77. }
  78. & > .td-sidebar-nav__section {
  79. padding-left: 1.5rem;
  80. }
  81. li i {
  82. // Layout of icons
  83. padding-right: 0.5em;
  84. &::before {
  85. display: inline-block;
  86. text-align: center;
  87. min-width: 1em;
  88. }
  89. }
  90. .td-sidebar-link.tree-root {
  91. font-weight: $font-weight-bold;
  92. border-bottom: 1px solid var(--bs-tertiary-color);
  93. margin-bottom: 1rem;
  94. }
  95. }
  96. .td-sidebar {
  97. @include link-decoration;
  98. @include media-breakpoint-up(md) {
  99. padding-top: 4rem;
  100. padding-right: 1rem;
  101. border-right: 1px solid var(--bs-border-color);
  102. }
  103. padding-bottom: 1rem;
  104. &__toggle {
  105. line-height: 1;
  106. color: var(--bs-body-color);
  107. margin: 1rem;
  108. }
  109. &__search {
  110. padding: 1rem 0;
  111. }
  112. &__inner {
  113. order: 0;
  114. @include media-breakpoint-up(md) {
  115. @supports (position: sticky) {
  116. position: sticky;
  117. top: 4rem;
  118. z-index: 10;
  119. height: calc(100vh - 5rem);
  120. }
  121. }
  122. @include media-breakpoint-up(xl) {
  123. flex: 0 1 320px;
  124. }
  125. .td-search-box {
  126. width: 100%;
  127. }
  128. }
  129. #content-desktop {
  130. display: block;
  131. }
  132. #content-mobile {
  133. display: none;
  134. }
  135. @include media-breakpoint-down(lg) {
  136. #content-desktop {
  137. display: none;
  138. }
  139. #content-mobile {
  140. display: block;
  141. }
  142. }
  143. }