_toc.less 912 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. .toc-wrapper{
  2. position:fixed;
  3. top: @header-height + @gap * 2;
  4. right: 50%;
  5. margin-right: -@container-width/2;
  6. transition: all .24s ease-out;
  7. // prevent toc is too heigh.
  8. overflow: auto;
  9. max-height: ~"calc(100% - @{header-height} - 2 * @{gap})";
  10. @media(max-width: @container-width){
  11. right: 0;
  12. margin-right:0;
  13. }
  14. @media(max-width: @on-phone){
  15. right: 3px - @side-width;
  16. margin-right:0;
  17. &.active{
  18. transform: translateX(-@side-width);
  19. }
  20. }
  21. width: @side-width;
  22. z-index:3;
  23. &:extend(.z-depth-2);
  24. padding: @gap;
  25. border-left: 3px solid @secondary-color;
  26. background: @white;
  27. a {
  28. display: inline-block;
  29. &:hover,&:active,&.active{
  30. color: @accent-color;
  31. }
  32. }
  33. ol{
  34. &.toc-child{
  35. padding-left: @gap;
  36. }
  37. li{
  38. list-style:none;
  39. width: auto;
  40. &:extend(.txt-ellipsis);
  41. }
  42. }
  43. &:empty{
  44. display:none;
  45. }
  46. }