Best WordPress Hosting
 

Sticky position block support

via make.wordpress.org => original post link

WordPress 6.2 adds a new position block support feature, beginning with support for sticky positioning, with the Group block opted-in by default. For themes using the appearanceTools feature in theme.json, the Group block will now be able to be set to “sticky”. The sticky positioning feature follows the CSS behavior for position: sticky which sets an element to stick to its immediate parent (in this case, the block’s immediate parent) when the user scrolls down the page.

Because it can be a potentially confusing feature to work with, for WordPress 6.2, the positioning controls will only be displayed for Group blocks at the root of the document.To create a sticky header in a site template, people building themes or sites can wrap a Header template part in a Group block and set that Group block to “sticky”.

This is just the beginning of the position block support feature, and there are ideas for future enhancements, including rolling out sticky to non-root blocks, and improving the UX surrounding building sticky site headers. There is an open issue in the Gutenberg repo to track progress beyond 6.2.