Skip to content

[css-position][css-sticky] Make sticky positioning less restrictive #5528

@ianthedev

Description

@ianthedev

The sticky positioning (position: sticky) was implemented in a way which is a bit too restrictive. We need a way to free a sticky element from being strictly confined within its direct parent.

A use case is that a blog post has a list of social sharing links. And that list needs to be sticky positioned at the left side of the blog post so that readers can always see the list when they are reading the blog post. However, in HTML code, the list is in the footer element of the blog. And without moving the list outside the footer element and to the very top of the blog post, the desired sticky positioning would be impossible.

So we need a way for freely defining within which parent element our sticky element is being sticky.

We also need a way that allows us to firstly position an element at whatever position we desire and then set it to a sticky element. Currently, we cannot do the first step with position: sticky because we can no longer use position: absolute in this case.

Current spec: https://www.w3.org/TR/css-position-3/#stickypos-insets

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions