Utilities for adding a fade effect to the edges of a scroll container.
The scroll-fade utility is purely composed of CSS and is based on shadcn/scroll-fade. No extensions to rxconfig.py are needed as it uses Tailwind v4 syntax.
If your project was set up with buridan init, you already have scroll-fade. It ships with the buridan package, which the CLI imports in your global CSS file.
Otherwise install the buirdan package:
uv run buridan init
Add scroll-fade or scroll-fade-y to the scroll container, i.e. the element that has overflow-y-auto.
The fade is scroll-aware and tracks the scroll position:
The fade is applied with mask-image, so it dissolves the content itself rather than overlaying a color. The mask uses a linear fade from transparent to black, so it adapts to any background without configuration. If your scroll area sits inside a card, put the background and border on a wrapper and scroll-fade on the inner scroller, so the fade dissolves the content and not the card.
If the content does not overflow, no fade is shown. You can apply scroll-fade to any list without checking whether it scrolls.
Use scroll-fade-x on containers that scroll horizontally, i.e. the element that has overflow-x-auto.
Use edge utilities when only one edge should track the scroll position.
scroll-fade-t
scroll-fade-b
scroll-fade-s
scroll-fade-e
The edge utilities are scroll-aware. Start edges fade in after you scroll away from the start, and end edges fade out when you reach the end. Use scroll-fade-t, scroll-fade-b, scroll-fade-l, and scroll-fade-r for physical edges. Use scroll-fade-s and scroll-fade-e for logical inline edges.
The fade depth defaults to 12% of the container, capped at 40px so tall scrollers stay subtle. Use scroll-fade-<number> to set a fixed size on the spacing scale instead, the same way scroll-mt-<number> works.
scroll-fade-4
scroll-fade-24
For one-off values, use an arbitrary length or percentage:
rx.el.div(..., class_name="scroll-fade overflow-y-auto scroll-fade-[15%]")
To fade opposite edges by different amounts, use the per-edge modifiers scroll-fade-t-<number>, scroll-fade-b-<number>, scroll-fade-s-<number>, and scroll-fade-e-<number>. They override scroll-fade-
rx.el.div(..., class_name="scroll-fade overflow-y-auto scroll-fade-b-8 scroll-fade-t-2")
Use scroll-fade-none to remove the fade. It works in any class order, so the typical use is responsive or stateful.
scroll-fade
scroll-fade scroll-fade-none
The scroll-aware behavior is implemented with CSS scroll-driven animations, with no JavaScript and no scroll listeners. In browsers that do not support scroll-driven animations, scroll-fade falls back to a static fade on both edges, and edge utilities fall back to a static fade on the selected edge.
Since the mask is applied to the scroll container itself, a visible scrollbar fades with the content at the edges. Pair scroll-fade with no-scrollbar, which ships in the same package, if you want to hide the scrollbar entirely.