_components.textbook__sidebar.scss 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /**
  2. * Styling for the sidebar.
  3. *
  4. * [1]: The sidebar is implemented as ul and li elements so we need to remove
  5. * the bullets and margins. Also make chapter fonts a bit bigger.
  6. * [2]: The entries are <a> tags so we need to remove the default styling.
  7. * [3]: The sidebar divider is just an empty element with a border.
  8. * [4]: The current section needs a higher specificity to override the :hover
  9. * selectors used previously.
  10. * [5]: The logo displayed above the sidebar
  11. * [6]: The footer at the bottom of the sidebar
  12. */
  13. $color-sidebar-bg: rgba(255, 255, 255, 0) !default;
  14. $color-sidebar-entry: #364149 !default;
  15. $color-sidebar-entry--active: $color-links !default;
  16. $color-sidebar-divider: #bbb !default;
  17. .c-textbook__sidebar {
  18. background-color: $color-sidebar-bg;
  19. padding: $spacing-unit-small;
  20. @include inuit-font-size(14px);
  21. border-right: 1px solid rgba(0, 0, 0, 0.07);
  22. opacity: 0.6;
  23. -webkit-transition: opacity 0.2s ease-in-out;
  24. transition: opacity 0.2s ease-in-out;
  25. &:hover {
  26. opacity: 1;
  27. }
  28. }
  29. /* [1] */
  30. .c-sidebar__chapters {
  31. list-style: none;
  32. margin-left: 0;
  33. margin-bottom: 0;
  34. }
  35. li.c-sidebar__chapter > a {
  36. font-size: 1.2em;
  37. }
  38. /* [1] */
  39. .c-sidebar__sections {
  40. list-style: none;
  41. margin-left: $spacing-unit-small;
  42. margin-bottom: 0;
  43. }
  44. li.c-sidebar__subsection {
  45. margin-left: 20px;
  46. }
  47. /* [2] */
  48. .c-sidebar__entry {
  49. display: block;
  50. padding: $spacing-unit-tiny;
  51. color: $color-sidebar-entry;
  52. text-decoration: none;
  53. &:hover {
  54. text-decoration: underline;
  55. }
  56. &:visited {
  57. color: $color-sidebar-entry;
  58. }
  59. }
  60. /* [4] */
  61. .c-sidebar__entry--active.c-sidebar__entry--active {
  62. color: $color-sidebar-entry--active;
  63. }
  64. /* [3] */
  65. .c-sidebar__divider {
  66. border-top: 1px solid $color-sidebar-divider;
  67. margin: $spacing-unit-tiny;
  68. }
  69. /* [5] */
  70. img.textbook_logo {
  71. margin-top: 20px;
  72. max-height: 100px;
  73. margin: 0px auto 20px auto;
  74. display: block;
  75. }
  76. /* [6] */
  77. p.sidebar_footer {
  78. text-align: center;
  79. padding: 10px 20px 0px 0px;
  80. font-size: .9em;
  81. }