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

durable-postcss-easing-gradients

v3.0.9

Published

PostCSS plugin to create smooth linear-gradients that approximate easing functions.

Readme

Durable PostCSS Easing Gradients

NPM Version MIT License

A PostCSS plugin to create smooth linear-gradients that approximate easing functions. This is a maintained fork of the original postcss-easing-gradients with updated dependencies and improved compatibility.

Visual examples and online editor available at larsenwork.com/easing-gradients

Why This Fork?

This fork addresses several issues with the original package:

  • Updated Dependencies: Compatible with PostCSS 8.x and modern Node.js versions
  • Bug Fixes: Improved HSL color handling and legacy format conversion
  • Maintained: Active maintenance and updates for the PostCSS ecosystem
  • Modern Build: Updated to work with current tooling and build systems

Installation

npm install durable-postcss-easing-gradients --save-dev

Usage

Add the plugin to your PostCSS configuration:

const postcss = require('postcss');
const easingGradients = require('durable-postcss-easing-gradients');

postcss([easingGradients()])
  .process(css, { from: undefined })
  .then(result => {
    console.log(result.css);
  });

With PostCSS Config File

// postcss.config.js
module.exports = {
  plugins: [
    require('durable-postcss-easing-gradients')(),
    // other plugins...
  ]
};

Code Examples

Cubic Bezier Easing

.cubic-bezier {
  background: linear-gradient(to bottom, black, cubic-bezier(0.48, 0.3, 0.64, 1), transparent);
}

Transforms to:

.cubic-bezier {
  background: linear-gradient(
    to bottom,
    hsl(0, 0%, 0%),
    hsla(0, 0%, 0%, 0.94505) 7.9%,
    hsla(0, 0%, 0%, 0.88294) 15.3%,
    hsla(0, 0%, 0%, 0.81522) 22.2%,
    hsla(0, 0%, 0%, 0.7426) 28.7%,
    hsla(0, 0%, 0%, 0.66692) 34.8%,
    hsla(0, 0%, 0%, 0.58891) 40.6%,
    hsla(0, 0%, 0%, 0.50925) 46.2%,
    hsla(0, 0%, 0%, 0.42866) 51.7%,
    hsla(0, 0%, 0%, 0.34817) 57.2%,
    hsla(0, 0%, 0%, 0.2693) 62.8%,
    hsla(0, 0%, 0%, 0.19309) 68.7%,
    hsla(0, 0%, 0%, 0.12126) 75.2%,
    hsla(0, 0%, 0%, 0.05882) 82.6%,
    hsla(0, 0%, 0%, 0.01457) 91.2%,
    hsla(0, 0%, 0%, 0)
  );
}

Named Easing Functions

.ease {
  background: linear-gradient(green, ease, red);
}

Step Functions

.steps {
  background: linear-gradient(to right, green, steps(4, skip-none), red);
}

Radial Gradients

.radial {
  background: radial-gradient(circle at top right, red, ease-in-out, blue);
}

Syntax

The plugin supports a subset of the proposed CSS syntax:

linear-gradient(
  [ <direction>,]?
  <color>,
  <animation-timing-function>,
  <color>
)

Supported Easing Functions

  • Named functions: ease, ease-in, ease-out, ease-in-out, linear
  • Cubic Bezier: cubic-bezier(x1, y1, x2, y2)
  • Steps: steps(number, direction) where direction can be jump-start, jump-end, jump-none, jump-both, or start/end (legacy)

Options

easingGradients({
  stops: 13,           // Number of color stops (default: 13)
  alphaDecimals: 5,    // Decimal precision for alpha values (default: 5)
  colorMode: 'lrgb'    // Color interpolation mode (default: 'lrgb')
})

Option Details

stops (default: 13)

Controls the number of intermediate color stops generated. Lower numbers create more "low poly" gradients with less code but higher risk of banding.

alphaDecimals (default: 5)

Sets decimal precision for alpha values. Lower numbers can result in visible banding.

colorMode (default: 'lrgb')

Defines the color space for interpolation:

  • 'lrgb' - Linear RGB (closest to browser behavior)
  • 'rgb' - Standard RGB
  • 'hsl' - HSL color space
  • 'lab' - LAB color space
  • 'lch' - LCH color space

See Chroma.js documentation for more details.

Browser Support

The generated CSS uses standard linear-gradient and radial-gradient syntax with HSL/HSLA colors, providing excellent browser support. The plugin itself requires Node.js 6.0.0 or higher.

Differences from Original

This fork includes several improvements over the original:

  1. PostCSS 8 Compatibility: Updated to work with the latest PostCSS version
  2. Modern Dependencies: All dependencies updated to their latest versions
  3. Enhanced HSL Handling: Better support for modern HSL syntax and legacy format conversion
  4. Bug Fixes: Resolved issues with color parsing and gradient generation
  5. Improved Testing: Updated test suite with Jest 29

Contributing

Contributions are welcome! Please feel free to submit a Pull Request. This fork aims to maintain compatibility with the original while providing modern tooling support.

License

MIT License - see the LICENSE file for details.

Acknowledgments

This project is a fork of postcss-easing-gradients by Andreas Larsen. All credit for the original concept and implementation goes to the original author.

The visual examples and online editor remain available at larsenwork.com/easing-gradients.