sidebar.less 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. // stylelint-disable selector-max-compound-selectors
  2. // By default it's not affixed in mobile views, so undo that
  3. .bs-docs-sidebar.affix {
  4. position: static;
  5. }
  6. @media (min-width: @screen-sm-min) {
  7. .bs-docs-sidebar {
  8. padding-left: 20px;
  9. }
  10. }
  11. .bs-docs-search {
  12. margin-bottom: 20px;
  13. margin-left: 20px;
  14. }
  15. // First level of nav
  16. .bs-docs-sidenav {
  17. margin-top: 20px;
  18. margin-bottom: 20px;
  19. }
  20. // All levels of nav
  21. .bs-docs-sidebar .nav > li > a {
  22. display: block;
  23. padding: 4px 20px;
  24. font-size: 13px;
  25. font-weight: 500;
  26. color: #767676;
  27. }
  28. .bs-docs-sidebar .nav > li > a:hover,
  29. .bs-docs-sidebar .nav > li > a:focus {
  30. padding-left: 19px;
  31. color: #563d7c;
  32. text-decoration: none;
  33. background-color: transparent;
  34. border-left: 1px solid #563d7c;
  35. }
  36. .bs-docs-sidebar .nav > .active > a,
  37. .bs-docs-sidebar .nav > .active:hover > a,
  38. .bs-docs-sidebar .nav > .active:focus > a {
  39. padding-left: 18px;
  40. font-weight: 700;
  41. color: #563d7c;
  42. background-color: transparent;
  43. border-left: 2px solid #563d7c;
  44. }
  45. // Nav: second level (shown on .active)
  46. .bs-docs-sidebar .nav .nav {
  47. display: none; // Hide by default, but at >768px, show it
  48. padding-bottom: 10px;
  49. }
  50. .bs-docs-sidebar .nav .nav > li > a {
  51. padding-top: 1px;
  52. padding-bottom: 1px;
  53. padding-left: 30px;
  54. font-size: 12px;
  55. font-weight: 400;
  56. }
  57. .bs-docs-sidebar .nav .nav > li > a:hover,
  58. .bs-docs-sidebar .nav .nav > li > a:focus {
  59. padding-left: 29px;
  60. }
  61. .bs-docs-sidebar .nav .nav > .active > a,
  62. .bs-docs-sidebar .nav .nav > .active:hover > a,
  63. .bs-docs-sidebar .nav .nav > .active:focus > a {
  64. padding-left: 28px;
  65. font-weight: 500;
  66. }
  67. // Back to top (hidden on mobile)
  68. .back-to-top,
  69. .bs-docs-theme-toggle {
  70. display: none;
  71. padding: 4px 10px;
  72. margin-top: 10px;
  73. margin-left: 10px;
  74. font-size: 12px;
  75. font-weight: 500;
  76. color: #999;
  77. }
  78. .back-to-top:hover,
  79. .bs-docs-theme-toggle:hover {
  80. color: #563d7c;
  81. text-decoration: none;
  82. }
  83. .bs-docs-theme-toggle {
  84. margin-top: 0;
  85. }
  86. @media (min-width: @screen-sm-min) {
  87. .back-to-top,
  88. .bs-docs-theme-toggle {
  89. display: block;
  90. }
  91. }
  92. // Show and affix the side nav when space allows it
  93. @media (min-width: @screen-md-min) {
  94. .bs-docs-sidebar .nav > .active > ul {
  95. display: block;
  96. }
  97. // Widen the fixed sidebar
  98. .bs-docs-sidebar.affix,
  99. .bs-docs-sidebar.affix-bottom {
  100. width: 213px;
  101. }
  102. .bs-docs-sidebar.affix {
  103. position: fixed; // Undo the static from mobile first approach
  104. top: 20px;
  105. }
  106. .bs-docs-sidebar.affix-bottom {
  107. position: absolute; // Undo the static from mobile first approach
  108. }
  109. .bs-docs-sidebar.affix-bottom .bs-docs-sidenav,
  110. .bs-docs-sidebar.affix .bs-docs-sidenav {
  111. margin-top: 0;
  112. margin-bottom: 0;
  113. }
  114. }
  115. @media (min-width: @screen-lg-min) {
  116. // Widen the fixed sidebar again
  117. .bs-docs-sidebar.affix-bottom,
  118. .bs-docs-sidebar.affix {
  119. width: 263px;
  120. }
  121. }