Jump to content

User talk:Phlsph7/UnfoldedNumberedTOC(Vector2022)

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Phlsph7 (talk | contribs) at 05:29, 26 January 2023 (CSS alternative: reply). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

CSS alternative

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]