Add new Sidebar Container block to handle sticky sidebar logic #397
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pulls out the sticky-related JS from the table of contents block, and ports over some CSS from the child themes, so that the sidebar pattern with table of contents can be reused — currently this component-pattern is used on Documentation, the new Developer site (in progress), and soon to be on the About subpages. By consolidating the code here, we can prevent duplicating the CSS across the child themes.
Additionally, this removes the use of
aside
for the sidebar, so it addresses some of the issue in WordPress/wporg-documentation-2022#58.See WordPress/wporg-documentation-2022#63 for how this will be used in a child theme— we can remove the CSS and simplify the template. If this goes forward, I'll make a similar PR for Developer.
Before
After