Best For
scrollytelling / scroll / narrative
滚动叙事
Scrolling is the narrative timeline. A sticky canvas pins to the viewport while text steps scroll past it, each step triggering a state change — numbers count, shapes morph, layers light up. Information reveals frame by frame with reading progress, like a New York Times data feature.
Best For
scrollytelling / scroll / narrative
Primary Move
Dark base #0E1116 with warm white text #F7F5F0 for a longform-feature immersion (or invert: light base, dark type)
Watch Out
Never read offsetTop/getBoundingClientRect in a scroll handler for continuous scrub (jank) — trigger discrete states with IntersectionObserver
Showcase Entry
Live preview of the showcase page. Click to explore the full experience.
Color Palette
Primary
#0E1116
Secondary
#F7F5F0
Accent 1
#2F6FED
Accent 2
#E8503A
AI Implementation
Use the Hard Prompt by default to generate UI. Use the Design Spec to understand, modify, and review the style. Use the Creative Brief for early exploration.
Use this by default: copy it, append the concrete requirement, and let AI generate consistent production UI.
When to use
How to use
STYLEKIT_STYLE_REFERENCE
style_name: Scrollytelling
style_slug: scrollytelling
style_source: /styles/scrollytelling
# Hard Prompt
## When To Use
Use this when you want AI to generate code with strict style consistency. It is the safest default for production UI.
## How To Use
- Copy the full prompt into ChatGPT, Claude, Cursor, or another coding assistant.
- Append the concrete product/page requirement after the prompt.
- After generation, check the forbidden rules and interaction states before accepting the output.
Strictly follow the style rules below and maintain consistency. No style drift allowed.
## Requirements
- Prioritize style consistency first, then creative extension.
- When conflicts arise, treat prohibitions as the highest priority.
- Self-check before output: verify colors, typography, spacing, and interactions still match this style.
## Style Rules
# Scrollytelling Design System
You are an expert frontend developer specializing in scrollytelling (scroll-driven data narrative). Generate all code strictly following these specifications.
## Style Identity
- **Name**: Scrollytelling
- **Essence**: Scrolling is playback; a sticky canvas + stepped text drive a data story
- **Mood**: Editorial, journalistic, considered, data-forward
- **Inspiration**: NYT / The Pudding / Reuters Graphics scroll-driven features
---
## Forbidden
| Pattern | Reason |
|---------|--------|
| Reading offsetTop/getBoundingClientRect in a scroll handler for continuous scrub | Jank; trigger discrete states with IntersectionObserver instead |
| Multiple new facts per step | Narrative tension collapses |
| Animating layout props on canvas states (top/width/height) | Use transform/opacity only |
| Count-up as the only source of a number | Screen readers and SEO can't read it |
| Canvas crowding out text on mobile | Text must stay readable |
| More than two accent colors | Turns to noise |
| Missing prefers-reduced-motion instant fallback | Accessibility is non-negotiable |
## Required
### Palette
- Dark base #0E1116, raised surface #1C2530, text #F7F5F0 (may invert to light)
- Lead accent signal blue #2F6FED (current focus)
- Alert contrast vermilion #E8503A (contrast/alerts only)
### Core Structure: Sticky Canvas + Stepped Text
Two overlaid parts:
1. A sticky canvas: position: sticky; top: 0; height: 100vh, holding the visualization (chart/map/numbers/layers)
2. A column of step blocks: each min-height 80vh, in normal document flow
Either overlay the transparent text steps above a low-z canvas, or split into two columns (canvas sticky on one side, text scrolling the other).
### Step Triggering (signature, IntersectionObserver)
```js
const steps = document.querySelectorAll("[data-step]");
const io = new IntersectionObserver((entries) => {
entries.forEach((e) => {
if (e.isIntersecting) setCanvasState(Number(e.target.dataset.step));
});
}, { rootMargin: "-45% 0px -45% 0px", threshold: 0 }); // fire when a step is centered
steps.forEach((s) => io.observe(s));
```
### Canvas State Switching
- Discrete states 0/1/2/3…, one focus each
- Layers cross-fade via .st-layer[data-active] controlling opacity/transform
- Number count-up: rAF tween from old to new, but keep the real end value in the DOM
### Honest Numbers
```html
<span aria-label="1,240 people">
<span data-count-to="1240" aria-hidden>0</span>
</span>
```
### React Implementation Notes
- useRef for canvas state, useState for current step
- Build the IntersectionObserver in useEffect, disconnect in cleanup
- reduced-motion: detect with matchMedia; if set, zero transition duration and jump numbers to final
### GSAP Recipe (preferred when gsap is available)
```js
import gsap from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";
gsap.registerPlugin(ScrollTrigger);
ScrollTrigger.create({ trigger: ".st-canvas", pin: true, start: "top top", end: "+=300%" });
gsap.utils.toArray("[data-step]").forEach((el, i) => {
ScrollTrigger.create({ trigger: el, start: "top center", onEnter: () => setState(i), onEnterBack: () => setState(i) });
});
```
### Typography
- Numbers/headlines in a grotesque sans (Archivo / Inter) for a data feel
- Step titles text-2xl~3xl bold, body max-width 40ch for stepped reading
- Chapter/step numbers in monospace + signal blue
## Self-Verification Checklist
- [ ] Dark base + one signal blue + one vermilion, no more than two accents
- [ ] Canvas is sticky-pinned while text steps scroll over it
- [ ] Steps trigger discrete states via IntersectionObserver, not continuous scroll scrub
- [ ] One focus revealed per step
- [ ] Count-up real values live in the DOM for screen readers
- [ ] Canvas transitions use transform/opacity only
- [ ] prefers-reduced-motion instant fallback present
## Absolute Bans (Match and Refuse)
If any of the following patterns appear, it is a style violation — rewrite without exception.
- read offsetTop/getBoundingClientRect in a scroll handler for continuous scrub (jank) — trigger discrete states with IntersectionObserver
- cram multiple new facts into one step (narrative tension collapses)
- animate layout properties on canvas states (top/width/height) — transform/opacity only
- let a count-up animation be the only source of a number (screen readers / SEO can't read it)
- let the canvas crowd out text on mobile
- use more than two accent colors
- omit the prefers-reduced-motion instant fallback
## Self-Check (Verify Before Shipping)
If any item fails, the style has drifted — fix before shipping.
- [ ] No purple-to-blue gradients
- [ ] No overused fonts (Inter, Roboto, Geist, Fraunces, Plus Jakarta Sans)
- [ ] No nested cards (cards inside cards)
- [ ] No gray text on colored backgrounds
- [ ] Body text contrast meets WCAG AA (>= 4.5:1)
- [ ] No bounce or elastic easing curves
- [ ] Animations have a prefers-reduced-motion fallback
- [ ] Body text line length capped at 65-75 characters
- [ ] No side-stripe accent borders (border-left/right > 1px)
- [ ] No gradient text (background-clip: text)
- [ ] No glassmorphism used as the default surface treatment
- [ ] No tiny uppercase tracked eyebrow labels above every section heading
- [ ] never read offsetTop/getBoundingClientRect in a scroll handler for continuous scrub (jank) — trigger discrete states with IntersectionObserver
- [ ] never cram multiple new facts into one step (narrative tension collapses)
- [ ] never animate layout properties on canvas states (top/width/height) — transform/opacity only
- [ ] never let a count-up animation be the only source of a number (screen readers / SEO can't read it)
- [ ] never let the canvas crowd out text on mobileUse it in your workflow
Drop this style's theme into an existing shadcn project with one command.
npx shadcn add https://www.stylekit.top/r/scrollytelling.jsonContributors can build the unpublished CLI from a local checkout.
pnpm --filter stylekit-cli build && node packages/cli/dist/index.js add scrollytellingContributors can preview Scrollytelling through the repository-local MCP package.
pnpm --filter stylekit-mcp build && node packages/mcp/dist/index.jsComponent Templates
Signal-blue step button with focus ring
Frontend Readiness
This layer tracks whether the style is ready for real websites: theme modes, state feedback, keyboard access, and performance constraints.
Overall
51%
Fallback
Dark Mode
0%
MissingUI States
79%
PartialMotion
70%
PartialA11y
70%
PartialPerformance
35%
FallbackButton
Default / Hover / Focus Visible / Active / Disabled
Input
Default / Hover / Focus Visible / Disabled / Error
Card
Default / Hover / Focus Visible / Loading / Skeleton
Form
Default / Focus Visible / Disabled / Loading / Error
/* Scrollytelling Global Styles */
:root {
--st-base: #0E1116;
--st-surface: #1C2530;
--st-paper: #F7F5F0;
--st-signal: #2F6FED;
--st-alert: #E8503A;
--st-ease: cubic-bezier(0.22, 1, 0.36, 1);
}
/* The pinned stage */
.st-sticky {
position: sticky;
top: 0;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
/* Step narration blocks — give each room to breathe */
.st-step {
min-height: 80vh;
display: flex;
align-items: center;
}
/* Canvas layers cross-fade / slide between discrete states (transform+opacity only) */
.st-layer {
transition: opacity 0.6s var(--st-ease), transform 0.6s var(--st-ease);
will-change: opacity, transform;
}
.st-layer[data-active="false"] { opacity: 0; }
.st-layer[data-active="true"] { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
.st-layer { transition: none; }
}IDE Integration
Download configuration files for AI coding assistants to generate code in this style.
Style Pack
Get complete machine-readable style assets including design tokens, Tailwind presets, CSS variables, and shadcn/ui themes.
Metadata
Style metadata including version information
Design Tokens
Compatible with Figma / Style Dictionary / Tokens Studio
Tailwind Preset
Tailwind CSS theme preset, import directly in config
Global CSS
CSS variables and base styles
shadcn Theme
shadcn/ui theme configuration
CSS Variables
Pure CSS variables, works with any project
SKILL.md
Loadable skill pack for Cursor / Claude Code / VS Code
The scrollytelling creed: scrolling is playback, not browsing. As the reader scrolls down they aren't turning pages — they're driving a timeline. Every scroll position maps to a frame of the story; the sticky canvas is the stage and the text steps are the narration.
WCAG 2.1 compliance analysis based on color contrast and typography readability.
Overall Score
Grade: B - Good
Contrast Ratios
| Context | Colors | Ratio | AA | AAA |
|---|---|---|---|---|
| Text on background | /#F7F5F0 / #0E1116 | 17.36:1 | ||
| Secondary text on background | /#F7F5F0 / #0E1116 | 17.36:1 | ||
| Muted text on background | /#F7F5F0 / #0E1116 | 17.36:1 | ||
| Text on secondary background | /#F7F5F0 / #1C2530 | 14.21:1 | ||
| Secondary text on secondary | /#F7F5F0 / #1C2530 | 14.21:1 | ||
| Button primary | /#ffffff / #2F6FED | 4.55:1 | ||
| Text on accent 1 | /#F7F5F0 / #2F6FED | 4.17:1 | ||
| Alt text on accent 1 | /#F7F5F0 / #2F6FED | 4.17:1 |
Readability
Score
87/100
Font Size
text-base md:text-lg
Font Weight
font-bold text-[#F7F5F0] tracking-tight
Line Height
default
Scoring is based on WCAG 2.1 standards. AA requires 4.5:1 contrast for normal text, 3:1 for large text; AAA requires 7:1 for normal text, 4.5:1 for large text.