_sidebar.scss 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. // stylelint-disable declaration-no-important
  2. //
  3. // Right side table of contents
  4. //
  5. .bd-toc {
  6. @supports (position: sticky) {
  7. position: sticky;
  8. top: 4rem;
  9. height: calc(100vh - 4rem);
  10. overflow-y: auto;
  11. }
  12. order: 2;
  13. padding-top: 1.5rem;
  14. padding-bottom: 1.5rem;
  15. font-size: .875rem;
  16. }
  17. .section-nav {
  18. padding-left: 0;
  19. border-left: 1px solid #eee;
  20. ul {
  21. padding-left: 1rem;
  22. ul {
  23. display: none;
  24. }
  25. }
  26. }
  27. .toc-entry {
  28. display: block;
  29. a {
  30. display: block;
  31. padding: .125rem 1.5rem;
  32. color: #99979c;
  33. &:hover {
  34. color: $blue;
  35. text-decoration: none;
  36. }
  37. }
  38. }
  39. //
  40. // Left side navigation
  41. //
  42. .bd-sidebar {
  43. order: 0;
  44. // background-color: #f5f2f9;
  45. border-bottom: 1px solid rgba(0, 0, 0, .1);
  46. @include media-breakpoint-up(md) {
  47. @supports (position: sticky) {
  48. position: sticky;
  49. top: 4rem;
  50. z-index: 1000;
  51. height: calc(100vh - 4rem);
  52. }
  53. border-right: 1px solid rgba(0, 0, 0, .1);
  54. }
  55. @include media-breakpoint-up(xl) {
  56. flex: 0 1 320px;
  57. }
  58. }
  59. .bd-links {
  60. padding-top: 1rem;
  61. padding-bottom: 1rem;
  62. margin-right: -15px;
  63. margin-left: -15px;
  64. @include media-breakpoint-up(md) {
  65. @supports (position: sticky) {
  66. max-height: calc(100vh - 9rem);
  67. overflow-y: auto;
  68. }
  69. }
  70. // Override collapse behaviors
  71. @include media-breakpoint-up(md) {
  72. display: block !important;
  73. }
  74. }
  75. .bd-search {
  76. position: relative; // To contain the Algolia search
  77. padding: 1rem 15px;
  78. margin-right: -15px;
  79. margin-left: -15px;
  80. border-bottom: 1px solid rgba(0, 0, 0, .05);
  81. .form-control:focus {
  82. border-color: $bd-purple-bright;
  83. box-shadow: 0 0 0 3px rgba($bd-purple-bright, .25);
  84. }
  85. }
  86. .bd-search-docs-toggle {
  87. line-height: 1;
  88. color: $gray-900;
  89. }
  90. .bd-sidenav {
  91. display: none;
  92. }
  93. .bd-toc-link {
  94. display: block;
  95. padding: .25rem 1.5rem;
  96. font-weight: 500;
  97. color: rgba(0, 0, 0, .65);
  98. &:hover {
  99. color: rgba(0, 0, 0, .85);
  100. text-decoration: none;
  101. }
  102. }
  103. .bd-toc-item {
  104. &.active {
  105. margin-bottom: 1rem;
  106. &:not(:first-child) {
  107. margin-top: 1rem;
  108. }
  109. > .bd-toc-link {
  110. color: rgba(0, 0, 0, .85);
  111. &:hover {
  112. background-color: transparent;
  113. }
  114. }
  115. > .bd-sidenav {
  116. display: block;
  117. }
  118. }
  119. }
  120. // All levels of nav
  121. .bd-sidebar .nav > li > a {
  122. display: block;
  123. padding: .25rem 1.5rem;
  124. font-size: 90%;
  125. color: rgba(0, 0, 0, .65);
  126. }
  127. .bd-sidebar .nav > li > a:hover {
  128. color: rgba(0, 0, 0, .85);
  129. text-decoration: none;
  130. background-color: transparent;
  131. }
  132. .bd-sidebar .nav > .active > a,
  133. .bd-sidebar .nav > .active:hover > a {
  134. font-weight: 500;
  135. color: rgba(0, 0, 0, .85);
  136. background-color: transparent;
  137. }