=== Description
Because the ToC starts "sticking" before the sticky header appears, there's some additional/unnecessary motion that occurs when the sticky header appears and the ToC slides down (to make room for it, so they don't overlap):
{F34930663}
From a CSS perspective this occurs when the `top` value of the `toc-wrapper` changes from 20px to ~60px.Currently, To avoid this additional/unnecessary motion we could anticipate the sticky header and set the `top` value for the ToC to ~60px to begin with. The resultthe table of contents assumes that the sticky header is always shown and offsets its `top` property to account for the sticky header's height.
However, when scrolling down thethe sticky header may not be enabled or may not be enabled for specific page,s. would be something like this:
{F34930664}Therefore, we need to make this offset conditional and based on whether the sticky header is/will be shown.
=== Notes
- This change is only needed when the sticky header is present, which means only for:
- logged-in people{F34951836}
=== Acceptance Criteria
- with browsers wider than 1000px (see T298836)[] Table of contents offsets its top position to account for the sticky header's height only when the sticky header is/will be shown
== Developer Notes
The sticky header has a utility class `.mw-sticky-header-element` that we could make use of here:
https://gerrit.wikimedia.org/r/c/mediawiki/skins/Vector/+/762559