// Table of contents nav#table-of-contents { background-color: $code-background; border-radius: 5px; @include light-para(13px); margin: 20px 0; padding: 20px; padding-left: 50px; line-height: 1.6 !important; #text-table-of-contents { background-color: $code-background; } h2 { @include light-meta(); margin-top: 10px; } } @media (min-width: 1280px) { nav#table-of-contents { z-index: 9999; // FIXME Chrome seems to treat this as position: absolute position: fixed; top: 200px; left: 50px; background-color: transparent; max-width: 50vw; padding: 0; #text-table-of-contents { background-color: $back-white; box-shadow: 0 0 2px; padding: 20px; display: none; max-height: 50vh; overflow: auto; ul { margin: 0; } } &:hover { #text-table-of-contents { display: block; } h2 { display: none; } } h2 { transform: rotate(-90deg); position: relative; top: 50px; } li::before { content: ""; } } } // // Fancy toc // ::-webkit-scrollbar { width: 10px; height: 8px; } ::-webkit-scrollbar-track { background:transparent; } ::-webkit-scrollbar-thumb { background:transparent; border-radius: 10px; } ::-webkit-scrollbar-thumb:hover { background:transparent; } @media (min-width: 1280px) { #table-of-contents { position: fixed; right: 4rem; top: 0; padding: 1em; width: 15rem; line-height: 1.5; margin-top: 4rem; h2 { margin-top: 0; } > div > ul { list-style: none; padding: 0; margin: 0; max-height: calc(100vh - 5rem - 40px); overflow-y: auto; overflow-x: visible; scrollbar-color: transparent transparent; scrollbar-width: thin; ul { padding-left: 2em; } > li { display: block; } } ul.active > li { display: block; } li { display: none; a { display: inline-block; color: $text-light; text-decoration: none; -webkit-transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1); transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1); // negating earlir styles text-shadow: none; background: none; } } li:hover, li:hover > ul > li { display: block !important; a { color: $text-gray; } } li.active > a { color: $text-dark; } li::before { content: ""; } } } @media (min-width: 1640px) { #table-of-contents { right: 10rem; } }