Description
If the TOC has been collapsed/hidden it can be opened in a menu. Currently the max-width on this TOC menu is 244px. We would like to remove that max-width and instead add a max-width that is a percentage of the article width: 95%.
Why add a max-width at all?
The width of the article provides a sort of implicit max-width. For example:
However allowing the TOC menu to be as wide as the article becomes an issue for:
narrow screens | logged-in people w/ sticky header |
---|---|
because there is not much room outside of the TOC to click in order to close it | because it goes off the edge of the screen |
AC
- The collapsed TOC menu no longer has a 220px fixed width
- The TOC menu has a max-width equaling 85% of the main content text (51em) when collapsed into the page title.
- The TOC menu has the same behavior when collapsed into other locations (i.e. the sticky header, floating on narrow screens)
- On narrow screens the TOC menu still never covers the text completely (uses 75vw)
- The TOC menu has a min width of 200px
- Ensure that the TOC never has a horizontal scrollbar (test super long section headings, specifically when opening the TOC from the sticky header)
Developer notes
Due to the variety of positions the collapsed TOC can occupy (in the page title, the sticky header, and floating) across multiple viewports, we decided to use a max-width of min( 51em, 75vw), where 51 is 85% of the main content width (60em), and 75vw is used on smaller viewports to ensure the menu never fully covers the text. This CSS value needs to be adjusted for the sticky header due to the specifics of how its positioned, but it results in the same resulting width.
QA Results - Beta
AC | Status | Details |
---|---|---|
1 | ✅ | T316056#8272501 |
2 | ✅ | T316056#8272501 |
3 | ✅ | T316056#8272501 |
4 | ✅ | T316056#8272501 |
5 | ✅ | T316056#8272501 |
6 | ✅ | T316056#8272501 |
QA Results - Prod
AC | Status | Details |
---|---|---|
1 | ✅ | T316056#8272548 |
2 | ✅ | T316056#8272548 |
3 | ✅ | T316056#8272548 |
4 | ✅ | T316056#8272548 |
5 | ✅ | T316056#8272548 |
6 | ✅ | T316056#8272548 |