Skip to content

[Feature request] Add overscroll options #1957

@MarcelloTheArcane

Description

@MarcelloTheArcane

On mobile UIs, you can have something called overscroll-behaviour which can help on removing 'pull to refresh' when scrolling.

It is also useful for chat boxes or other contained UI elements - see this MDN example.

It would be really handy to add this to Tailwind!

Values

  • auto - The default scroll overflow behavior occurs as normal.
  • contain - Default scroll overflow behavior is observed inside the element this value is set on (e.g. "bounce" effects or refreshes), but no scroll chaining occurs to neighbouring scrolling areas, e.g. underlying elements will not scroll.
  • none - No scroll chaining occurs to neighbouring scrolling areas, and default scroll overflow behavior is prevented.

There is overscroll-behaviour, overscroll-behaviour-y and overscroll-behaviour-x.

Proposed API

Add the following class definitions:

.overscroll-auto {
  overscroll-behaviour: auto;
}
.overscroll-contain {
  overscroll-behaviour: contain;
}
.overscroll-none {
  overscroll-behaviour: none;
}

.overscroll-y-auto {
  overscroll-behaviour-y: auto;
}
.overscroll-y-contain {
  overscroll-behaviour-y: contain;
}
.overscroll-y-none {
  overscroll-behaviour-y: none;
}

.overscroll-x-auto {
  overscroll-behaviour-x: auto;
}
.overscroll-x-contain {
  overscroll-behaviour-x: contain;
}
.overscroll-x-none {
  overscroll-behaviour-x: none;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions