User talk:Phlsph7/UnfoldedNumberedTOC(Vector2022)

Latest comment: 1 year ago by Phlsph7 in topic CSS alternative

CSS alternative edit

In case it helps, I hacked together an unfolded TOC with this CSS. I'm not sure if that's the best way to do it in CSS, nor of the pros/cons of CSS vs JS, but it works for me. :) Quiddity (talk) 22:56, 25 January 2023 (UTC)Reply

Hi Quiddity and thanks for letting me know. The key piece in your file doing the unfolding seems to be the following:
.client-js .vector-toc .vector-toc-level-1 .vector-toc-list-item {
  display: block;
}
My script adds the class "vector-toc-list-item-expanded" to the top-level TOC list elements. This is also what happens when unfolding the TOC manually. I'm in the same boat as you in the sense that I'm not sure whether there are important advantages and disadvantages to these approaches. Phlsph7 (talk) 05:29, 26 January 2023 (UTC)Reply