_components.sidebar-right.scss 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. /**
  2. * Styling for within-page navigation.
  3. *
  4. * [1]: When the screen is large enough to hold the sidebar, place the sidebar
  5. * offset a bit off the right side of the screen.
  6. *
  7. * [2]: When the screen is large enough that the page content itself starts
  8. * having margins, use a semi-hack to position the sidebar just the right
  9. * offset from the center of the screen to be in the correct spot. We're
  10. * aiming to have the sidebar positioned just to the right of the page
  11. * content which means we take the page width without the sidebar, divide it
  12. * by 2, and add padding.
  13. */
  14. /* [2] */
  15. .sidebar__right > * {
  16. direction: ltr;
  17. }
  18. aside.sidebar__right {
  19. // Positioning
  20. overflow-x: hidden;
  21. background-color: $book-background-color;
  22. overflow-y: auto;
  23. max-height: 90vh; // Required for scrolling to work properly
  24. scrollbar-width: thin;
  25. direction: rtl;
  26. // Font and look
  27. font-family: -apple-system, BlinkMacSystemFont, 'Roboto', 'Segoe UI',
  28. 'Helvetica Neue', 'Lucida Grande', Arial, sans-serif;
  29. color: #7a8288;
  30. border-left: 1px solid #c3c3c3;
  31. text-transform: uppercase;
  32. letter-spacing: 1px;
  33. // Icon
  34. img {
  35. width: 15px;
  36. padding-bottom: 2px;
  37. }
  38. // Show/hide navbar underneath
  39. nav {
  40. transition: opacity .25s ease-in-out, height .25s ease-in-out;
  41. -moz-transition: opacity .25s ease-in-out, height .25s ease-in-out;
  42. -webkit-transition: opacity .25s ease-in-out, height .25s ease-in-out;
  43. overflow-y: hidden;
  44. opacity: 0;
  45. height: 0px;
  46. @include mq($from: desktop) {
  47. opacity: 100;
  48. height: auto;
  49. }
  50. @include mq($from: laptop) {
  51. &.no_sidebar_content {
  52. opacity: 100;
  53. height: auto;
  54. }
  55. }
  56. }
  57. &:hover nav {
  58. opacity: 100;
  59. height: auto;
  60. }
  61. }
  62. h4.nav__title {
  63. color: #7a8288;
  64. margin: 0;
  65. padding: 0.5rem 1rem;
  66. font-family: -apple-system, BlinkMacSystemFont, 'Roboto', 'Segoe UI',
  67. 'Helvetica Neue', 'Lucida Grande', Arial, sans-serif;
  68. font-size: 0.8em;
  69. font-weight: bold;
  70. }
  71. ul.toc__menu {
  72. margin: 0;
  73. padding: 0;
  74. width: 100%;
  75. list-style: none;
  76. font-size: 0.8rem;
  77. }
  78. ul.toc__menu a {
  79. display: block;
  80. padding: 0.25rem .75rem;
  81. color: #898c8f;
  82. font-size: 0.8em;
  83. font-weight: bold;
  84. line-height: 1.5;
  85. }
  86. .toc__menu ul {
  87. margin-left: 0px;
  88. }
  89. .toc__menu li ul {
  90. li {
  91. list-style-type: none;
  92. padding-left: 18px;
  93. }
  94. a {
  95. font-weight: normal;
  96. padding: 0.25rem .5rem;
  97. }
  98. }
  99. // Active sidebar entries
  100. nav.onthispage li.active a {
  101. color: #0077d8;
  102. }
  103. li.active {
  104. border-left: 1px solid #0077d8;
  105. margin-left: -1px;
  106. }