Scroll Fade

Utilities for adding a fade effect to the edges of a scroll container.

Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
Item 7
Item 8
Item 9
Item 10
Item 11
Item 12

Installation

scroll-fade ships with Spartan's Tailwind preset ( hlm-tailwind-preset.css ). Projects set up with the Spartan CLI already have it — no extra install step.

Usage

Add scroll-fade or scroll-fade-y to the scroll container — the element with overflow-y-auto . Put borders and backgrounds on a wrapper so the fade dissolves content, not the frame.

ClassWhat it does
scroll-fade / scroll-fade-yFade top and bottom edges (vertical scroll)
scroll-fade-xFade start/end edges (horizontal scroll, RTL-aware)
scroll-fade-t / scroll-fade-bFade only the top or bottom edge
scroll-fade-l / scroll-fade-rFade only the left or right edge
scroll-fade-s / scroll-fade-eLogical start/end edges (mirror in RTL)
scroll-fade-*Fixed fade depth on the spacing scale
scroll-fade-t-* / scroll-fade-b-* / scroll-fade-s-* / scroll-fade-e-* Configurable fade depth on the top, bottom, start, or end edge
scroll-fade-noneDisable the fade

The fade is scroll-aware: at rest the start edge is crisp and the end fades; mid-scroll both edges fade; at the end the trailing edge sharpens. Pair with no-scrollbar to hide the scrollbar. Attachment groups use scroll-fade-x .

No Overflow, No Fade

If the content does not overflow, no fade is shown.

Item 1
Item 2
Item 3

Horizontal Scrolling

Use scroll-fade-x on containers with overflow-x-auto .

Design
Engineering
Marketing
Product
Research
Sales
Support
Operations
Finance
Legal
People
Security

Edge Fades

Use edge utilities when only one edge should track the scroll position. Prefer scroll-fade-s / scroll-fade-e for logical inline edges that mirror in RTL.

Inbox triage
Design review
API contract
QA pass
Launch notes
Metrics follow-up

scroll-fade-t

Inbox triage
Design review
API contract
QA pass
Launch notes
Metrics follow-up

scroll-fade-b

Design
Engineering
Marketing
Product
Research
Sales
Support
Operations

scroll-fade-s

Design
Engineering
Marketing
Product
Research
Sales
Support
Operations

scroll-fade-e

Fade Size

The fade depth defaults to 12% of the container, capped at 40px . Use scroll-fade-* to set a fixed size on the spacing scale.

Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
Item 7
Item 8

scroll-fade-4

Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
Item 7
Item 8

scroll-fade-24

Disabling the Fade

Use scroll-fade-none to remove the fade. It works in any class order, so you can toggle it responsively or by state.

Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
Item 7
Item 8

scroll-fade

Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
Item 7
Item 8

scroll-fade scroll-fade-none

RTL

scroll-fade-x follows the reading direction. At rest, the start edge is crisp and the end edge fades.

تصميم
هندسة
تسويق
منتج
أبحاث
مبيعات
دعم
عمليات
مالية
قانوني
Shimmer Tooltip