Page MenuHomePhabricator

[ToC] Content should be centered when TOC is collapsed
Closed, ResolvedPublic2 Estimated Story Points

Description

Description

In T307901: Add link that allows to hide/show the ToC manually on all screen sizes above 1000px we made the ToC collapsible at all widths. When the ToC is collapsed the content should be centered (at all widths).

Prototype
https://di-collapsible-menus.web.app/Flamingo

Demo

Acceptance criteria

  • when ToC is collapsed, content is centered on page (at all widths)

QA

  • QA the example in the bug report
  • Do some exploratory testing on special pages, opening and closing the sidebar and table of contents. Make sure the max-width is applying correctly. For example on Special:RecentChanges the max-width shouldn't apply and on Special:Preferences it should always apply.

Event Timeline

When we get a fix for this, it would be great to backport it rather than waiting for the train

alexhollender_WMF renamed this task from Content location and width look unbalanced when ToC collapsed to [ToC] Content should be centered when TOC is collapsed.Aug 5 2022, 2:46 PM
alexhollender_WMF updated the task description. (Show Details)

The easiest way to do this will be to add the vector-sidebar-container-no-toc class to vector-sidebar-container whenever the move out of the sidebar button is clicked.

Jdlrobson subscribed.

Change 823162 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/skins/Vector@master] [ToC] Content should be centered when TOC is collapsed

https://gerrit.wikimedia.org/r/823162

cjming subscribed.

Change 823162 merged by jenkins-bot:

[mediawiki/skins/Vector@master] [ToC] Content should be centered when TOC is collapsed

https://gerrit.wikimedia.org/r/823162

Change 823213 had a related patch set uploaded (by Bernard Wang; author: Bernard Wang):

[mediawiki/skins/Vector@master] Follow-up: Remove 'vector-sidebar-container-no-toc' class in favor of 'vector-toc-visible' and 'vector-toc-not-visible' body classes, clean up CSS selectors and update TOC helpers in SkinVector22.php

https://gerrit.wikimedia.org/r/823213

vaughnwalters subscribed.

AC passes 👍
Macbook pro
testing with: https://en.wikipedia.beta.wmflabs.org/wiki/Brown_bear

  • when ToC is collapsed, content is centered on page (at all widths)

Chrome:

resize.gif (268×600 px, 2 MB)

Confirming this is fixed on production and resolving

Screen Shot 2022-08-25 at 11.01.04 AM.png (1×2 px, 817 KB)