Skip to content

[css-selectors] :stuck pseudo-class feature suggestion #1656

Closed
@o-t-w

Description

@o-t-w

I would like to propose a new pseudo class for use in conjunction with position sticky.
When an element with a position of sticky is fixed, it would have a pseudo class of :stuck
I see people do this all the time with javascript.

One example can be found https://percussionplus.co.uk/checkout/ where the checkout gets a box-shadow when it goes from acting as if it was statically positioned to acting as if it was fixed positioned.
One very common use case: People often animate the height of sticky headers when the user starts scrolling.

I'm sure this would be easy for browser vendors to implement.

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