跳到主要内容

ui/build/layout/scroll-affordance.svelte

ui/build/layout/scroll-affordance.svelte

Functions

scrollAffordance()

function scrollAffordance(options?): (node) => () => void;

Defined in: apps/website/.api-docs-entry/ui/build/layout/scroll-affordance.svelte.d.ts:19

Publish scroll position as attributes on a scrollport.

<div class="overflow-y-auto" {@attach scrollAffordance()}>…</div>

<Scroll> applies it already; reach for it directly only on a scrollport that cannot be one, such as a component's internal rail.

The edges also decide overscroll-behavior: base.css contains chaining only on an edge with content past it, because Chrome stops the chain at every contain'ed scroll container, scrollable or not, and an inert region would otherwise trap the wheel meant for its ancestor.

fade: false keeps the edges but stamps data-fade="false" so the mask stays off for a region whose content must stay opaque to its own edge. Its scrollbar still follows the global hover-only rule.

Parameters

Parameter Type
options? { fade?: boolean; }
options.fade? boolean

Returns

(node) => () => void