npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

postcss-spring

v1.3.0

Published

PostCSS plugin that helps you with spring easings

Readme

PostCSS Spring

A PostCSS plugin that adds spring easings using CSS linear(), making it easy to incorporate spring animations into your project. Define just two parameters and let the plugin do the rest.

Input:

.my-box {
    transition: transform spring-duration(200) spring-bounce(30);
}

Output (simplified):

.my-box {
    transition: transform calc(200ms * 1.66) linear(...);
}

Disclaimer: Credits goes to Kevin Grajeda and Jake Archibald. This Plugin is a port of Kevin's tailwindcss-spring plugin to PostCSS.

Additional Features

  • Fallback support for the linear() function in older browsers. You can configure the fallbackEasing in the plugins options. The default is ease.
  • linear() function caching. Reuse generated values for the same bounce values to keep the css as small as possible.

Installation

npm i -D postcss-spring

And add it to your PostCSS configuration.

module.exports = {
    plugins: [require('postcss-spring')],
};

Usage

This plugin uses a two-parameter approach to define spring easings: bounce and perceptual duration. For more informations i recommend reading Effortless UI Spring Animations.

This plugin adds two functions to your CSS: spring-bounce() and spring-duration(). You can use them to define your spring easings. The spring-bounce function returns the generated linear() value and adds a duration multiplier via css variables wich then is picked up by the spring-duration function.

Here is a basic example:

.my-box {
    transition: transform spring-duration(200) spring-bounce(30);
}

It also works with animations:

.my-box {
    animation: my-animation spring-duration(200) spring-bounce(30);
}

You could also use different values in the same declaration like this:

.my-box {
    transition: transform spring-duration(200) spring-bounce(0), scale spring-duration(400) spring-bounce(70);
}

or like this:

.my-box {
    transition-duration: spring-duration(200), spring-duration(200);
    transition-property: transform, scale;
    transition-timing-function: spring-bounce(0), spring-bounce(70);
}

Note that we still need to declare the same spring-duration multiple times, so it can correctly pick up the generated duration multiplier of the related ease. Otherwise the transition would be off.

JavaScript Usage

For advanced usage we also expose the generateSpring function from postcss-spring/runtime. You can use it to generate the linear easing and the duration multiplier and use it then like you want.

import { generateSpring } from 'postcss-spring/runtime';

const { durationMultiplier, ease } = generateSpring(20);