_sidenav.scss 2.8 KB

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