table-of-content.scss 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. @use '../mixins' as *;
  2. .toc-wrapper {
  3. display: none;
  4. padding-left: 64px;
  5. .toc-content {
  6. position: sticky;
  7. top: calc(var(--header-height) + 32px);
  8. margin-top: 0;
  9. padding: 4px 8px 4px 12px;
  10. margin-bottom: 32px;
  11. width: 200px;
  12. .toc-marker {
  13. opacity: 0;
  14. position: absolute;
  15. background-color: var(--brand-color);
  16. border-radius: 4px;
  17. width: 4px;
  18. height: 14px;
  19. top: 30px;
  20. left: 0;
  21. z-index: 0;
  22. transition: top 0.25s cubic-bezier(0, 1, 0.5, 1), opacity 0.25s,
  23. background-color 0.5s;
  24. }
  25. &__heading {
  26. font-size: 12px;
  27. color: var(--text-color-light);
  28. font-weight: 600;
  29. text-transform: uppercase;
  30. margin-top: 0;
  31. }
  32. .toc-items {
  33. list-style: none;
  34. padding: 0;
  35. margin: 12px 0 0;
  36. line-height: 1.2;
  37. .toc-item {
  38. margin-top: 10px;
  39. font-size: 11px;
  40. color: var(--text-color-lighter);
  41. text-overflow: ellipsis;
  42. overflow: hidden;
  43. white-space: nowrap;
  44. color: inherit;
  45. .toc-link {
  46. position: relative;
  47. color: var(--text-color-lighter);
  48. transition: color var(--el-transition-duration);
  49. &.active {
  50. color: var(--brand-color);
  51. }
  52. }
  53. &.subitem {
  54. padding-left: 1rem;
  55. }
  56. }
  57. }
  58. }
  59. @include respond-to('xxl') {
  60. display: block;
  61. }
  62. @include respond-to('max') {
  63. padding-left: 96px;
  64. display: block;
  65. }
  66. }