My static website generator using poole https://www.xythobuz.de
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

auto_toc.css 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #content {
  2. counter-reset: heading;
  3. }
  4. #content h2:not(.toc):before {
  5. content: counter(heading)") ";
  6. counter-increment: heading;
  7. }
  8. #content h2:not(.toc) {
  9. counter-reset: subheading;
  10. }
  11. #content h3:not(.toc):before {
  12. content: counter(heading)"." counter(subheading)") ";
  13. counter-increment: subheading;
  14. }
  15. #content h3:not(.toc) {
  16. counter-reset: subsubheading;
  17. }
  18. #content h4:not(.toc):before {
  19. content: counter(heading)"." counter(subheading)"." counter(subsubheading)") ";
  20. counter-increment: subsubheading;
  21. }
  22. #toc {
  23. float: right;
  24. width: fit-content;
  25. font-size: smaller;
  26. padding: 0 0.5em;
  27. border-width: 2px;
  28. border-style: solid;
  29. border-radius: 10px;
  30. max-height: 50vh;
  31. overflow: auto;
  32. }
  33. #toc_wrap {
  34. display: none;
  35. }
  36. @media (min-width: 1000px) {
  37. #toc_wrap {
  38. display: block;
  39. float: right;
  40. position: sticky;
  41. max-width: 12%;
  42. top: 1em;
  43. }
  44. }
  45. @media (min-height: 750px) {
  46. #toc_wrap {
  47. top: 8em;
  48. }
  49. }
  50. @media (min-width: 1500px) {
  51. #toc_wrap {
  52. right: 100px;
  53. }
  54. }
  55. #toc ul, .toc {
  56. margin: 0.25em 0;
  57. }
  58. #toc ul {
  59. padding-left: 1em;
  60. }
  61. #toc_close {
  62. opacity: 0.666;
  63. }
  64. #toc_close:hover {
  65. cursor: pointer;
  66. }