Jump to content

User talk:Phlsph7/UnfoldedNumberedTOC(Vector2022)

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is the current revision of this page, as edited by Marcus Markup (talk | contribs) at 11:39, 15 June 2024 (Reverted 1 edit by 51.211.209.169 (talk) to last revision by Phlsph7). The present address (URL) is a permanent link to this version.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

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]