Background
In T193772: [Research] In-article navigation user testing we tested a number of prototypes for in-article navigation. We settled on sticky headers as the best way forward
Acceptance criteria
- This should be in beta and replace the back to top feature
- Build sticky header navigation as per the prototype in https://in-article-navigation.firebaseapp.com/sticky-headers.html
- for non-js browsers sections should remain expanded by default
- as user scrolls headings attach themselves to top of screen
- if user scrolls past a new heading any previous headings are detached from top of screen
- For tablets:
- do not remove toc
- do not collapse all sections
Developer notes
- We can do this in CSS only with CSS feature queries - https://developer.mozilla.org/en-US/docs/Web/CSS/@supports
- A very recent post in the MDN newsletter considered sticky headers https://medium.com/@joshmarinacci/sticky-headers-for-your-css-tables-5488eb013914