@adam.plesnik/tailwindcss-scroll-driven-animations

中文文档
0.4.1发布于 2026/11/02MITCommonJS零依赖近 30 天下载 3740

A plugin for Tailwind CSS v4+ that provides utilities for scroll-driven animations.

原始使用文档
文档目录8 节
  1. Installation
  2. Tailwind CSS v3
  3. Usage
  4. Animation Timeline
  5. Scroll and View Timeline
  6. Range
  7. Scope
  8. Browser Support

Scroll-driven Animations for Tailwind CSS

'License' 'Checks' 'Stars'

Unofficial and experimental plugin for Tailwind CSS v4+ that provides utilities for scroll-driven animations.

unofficial experimental

Installation

Install the plugin from npm:

npm install @adam.plesnik/tailwindcss-scroll-driven-animations

Then register the plugin in your main CSS file with the @plugin directive:

@import 'tailwindcss';
@plugin '@adam.plesnik/tailwindcss-scroll-driven-animations';

Tailwind CSS v3

Tailwind CSS v3.4+ is supported by the v0.3.x releases of this plugin. Install that version:

npm install @adam.plesnik/[email protected]

Then add the plugin to your tailwind.config.js:

module.exports = {
  plugins: [
    require('@adam.plesnik/tailwindcss-scroll-driven-animations'),
    // ...
  ],
}

Usage

The plugin provides utilities for a subset of CSS scroll-driven animation properties.

  • animation-timeline
  • animation-range
  • scroll-timeline, view-timeline
  • timeline-scope

Animation Timeline

The single most impressive feature of scroll-driven animations is an anonymous animation timeline. It allows user to easily trigger anything just by scrolling the page. The plugin allows user to use the .timeline CSS class which defaults to animation-timeline: scroll(y) and also provides an option to set custom timeline name with a modifier.

Scroll and View Timeline

Scroll and View timelines provide user with better control over the animations. Both .scroll-timeline and .view-timeline are meant to be used with modifiers to set the timeline name.

Range

Animation range controls start and end of an animation. Utility class .range offers various options along with a possibility to use length modifiers.

Scope

Timeline scope allows to control animated elements outside the parent which defines the timeline. Utility .scope should be used with a modifier to define the timeline name set by .scroll-timeline or .view-timeline.

Browser Support

Scroll-driven animations are supported as of May 2026, but should be used with caution. Use the no-animations:... variant for fallback styling.

版本与发布记录

@adam.plesnik/tailwindcss-scroll-driven-animations 共发布 19 个版本,首次发布于 2024/03/30;过去 12 个月发布了 2 个版本。

版本发布日期距今
0.4.1latest2026/11/025 天前
0.4.02026/11/025 天前
0.3.02025/02/151.7 年前
0.2.72024/04/252 年前
0.2.62024/04/172 年前
0.2.52024/04/122 年前

关于 @adam.plesnik/tailwindcss-scroll-driven-animations 的常见问题

@adam.plesnik/tailwindcss-scroll-driven-animations 是什么?

A plugin for Tailwind CSS v4+ that provides utilities for scroll-driven animations.

如何安装 @adam.plesnik/tailwindcss-scroll-driven-animations?

在项目目录运行 npm install @adam.plesnik/tailwindcss-scroll-driven-animations,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:tailwindcss(>=4.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@adam.plesnik/tailwindcss-scroll-driven-animations 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/adam.plesnik__tailwindcss-scroll-driven-animations 是否存在。

@adam.plesnik/tailwindcss-scroll-driven-animations 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@adam.plesnik/tailwindcss-scroll-driven-animations 可以商用吗?

@adam.plesnik/tailwindcss-scroll-driven-animations 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@adam.plesnik/tailwindcss-scroll-driven-animations 的下载量有多少?

根据 npm 官方下载统计,@adam.plesnik/tailwindcss-scroll-driven-animations 在 2026/10/05 – 2026/11/03 这 30 天内被下载 3,740 次,日均约 125 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@adam.plesnik/tailwindcss-scroll-driven-animations 还在维护吗?

最新版本 0.4.1 发布于 2026/11/02(5 天前);至今共发布 19 个版本,其中过去 12 个月发布了 2 个;首次发布于 2024/03/30。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。