Skip to content

Animation & Motion

Scroll Restraint

Free

Use scroll-linked motion rarely, and never to hide content the reader needs.

Difficulty intermediate
Version v1.1

Purpose

Prevent scroll-jacking and reveal-on-scroll that delays reading.

Procedure

--- name: scroll-restraint description: Use scroll-linked motion rarely, and never to hide content the reader needs. ---

Scroll Restraint

Purpose

Prevent scroll-jacking and reveal-on-scroll that delays reading.

Procedure

Default: content is visible. Do not gate paragraphs on intersection observers.

Scroll-linked animation is justified only when position encodes meaning (a reading progress indicator for a long article, a sticky step list that highlights the current step). It is not justified for marketing fade-ups.

If you add a progress indicator:

  • It does not intercept wheel or touch. The browser scrolls natively.
  • It uses transform or a scale on a bar, not layout properties on every frame.
  • It is removed under prefers-reduced-motion.

Do not add GSAP, Lenis, or a smooth-scroll library unless the repository already depends on it and the user asked for that effect. Smooth-scroll libraries break find-in-page and accessibility unless carefully integrated. Prefer not to.

Never pin a section (scroll jack) on a documentation or application page.

Check that the page still scrolls on a trackpad and on a phone, including inside a dialog.

Example requests

1. Remove a reveal

Request: The docs page fades each section in on scroll. Apply Scroll Restraint. Expected: Content visible by default. Any remaining motion is optional and cheap.

Dependencies

None. Work in the repository that is already open. Do not add packages unless the procedure names one.

Compatibility

This document follows the Agent Skills layout (a folder named scroll-restraint containing SKILL.md). Claude Code, Cursor, Codex, and Gemini CLI can load that file from the paths in the Skilling installation guide. GitHub Copilot does not load SKILL.md. Use the Copilot instructions copy, and narrow applyTo before you commit it.

Example prompts

Remove a reveal

The docs page fades each section in on scroll. Apply Scroll Restraint.

Expected: Content visible by default. Any remaining motion is optional and cheap.

Choose the agent

This skill is installed for one agent at a time. Pick the section you are using.

Related

  • Motion Rules

    Add motion only to explain a change: 150–250ms, ease-out, and a reduced-motion path.

  • Motion Budget

    Set a budget for motion on one surface: what may move, for how long, and what must stay still.

  • Reduced Motion

    Audit animations and provide an equivalent instant state when the user asks for less motion.

Reviews

No reviews yet.

    Sign in to review.

    Report a problem

    Inaccurate steps, an unsafe instruction, or a licensing concern.

    Sign in to report.