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

fadekit

v0.3.2

Published

Smooth, eased fades for Tailwind CSS. Gradients without the hard edge.

Readme

fadekit

Formerly tailwindcss-better-gradient. Every class works the same; only the package name changed.

Smooth, eased fades for Tailwind CSS. A plain bg-linear-to-t from-black changes opacity at a constant rate, which leaves a visible hard edge where the gradient ends. This plugin builds the gradient from an easing curve instead, so overlays melt into whatever is behind them.

<div class="fade-from-black fade-to-t"></div>

Features

  • 🎨 Any color: the palette, opacity modifiers (/50), arbitrary values ([#123456]) and CSS variables ((--brand))
  • 📐 8 directions plus any angle (fade-to-45, fade-to-[200deg])
  • 🎯 24 easing curves plus any cubic-bezier()
  • 🎚️ Automatic stop count: the plugin uses the fewest stops that still look smooth, placed where the curve bends the most
  • 🔧 Composable in any order, and compatible with variants (hover:, md:, dark:), without !important
  • ⚡ Zero dependencies (except Tailwind CSS)

Installation

npm install fadekit

Requires Tailwind CSS v4.

@import 'tailwindcss';
@plugin "fadekit";

Usage

A fade is a color, optionally with a direction and a curve:

<!-- Color → transparent, fading toward the top (the default direction) -->
<div class="fade-from-black"></div>

<!-- Transparent → color -->
<div class="fade-to-blue-500 fade-to-b"></div>

<!-- Pick a curve, optionally with an explicit number of stops -->
<div class="fade-from-black fade-to-t fade-scrim"></div>
<div class="fade-from-black fade-to-t fade-ease-in-out/12"></div>

<!-- Variants work on every part -->
<div class="fade-from-black/60 fade-to-b md:fade-to-r hover:fade-from-black/80"></div>

Colors

| Class | Fade | | ------------------- | ------------------------------------------------- | | fade-from-{color} | from the color to transparent | | fade-to-{color} | from transparent to the color | | fade | from --color-background (white if it isn't set) |

{color} can be any theme color (blue-500, black, current), use an opacity modifier (black/50), an arbitrary value ([#0ea5e9]) or a CSS variable ((--brand)).

Direction

| Class | Angle | | ----------------------------------------- | ------------------------------ | | fade-to-t (default) | 0deg | | fade-to-tr / fade-to-r / fade-to-br | 45deg / 90deg / 135deg | | fade-to-b / fade-to-bl / fade-to-l | 180deg / 225deg / 270deg | | fade-to-tl | 315deg | | fade-to-{n}, fade-to-[{angle}] | any angle |

The direction is the way the color fades out. fade-from-black fade-to-t is solid at the bottom and transparent at the top, the same as bg-linear-to-t from-black.

Curve

| Class | Curve | | ------------------------ | ----------------------------------------------------------------- | | (none) | ease-out-cubic | | fade-{easing} | any easing below, automatic number of stops | | fade-{easing}/{n} | the same easing with exactly n stops (2–24, or /[n] up to 64) | | fade-{n} | the default easing with n stops | | fade-[cubic-bezier(…)] | any cubic-bezier (also fade-ease-[cubic-bezier(…)]) |

Easings: linear, scrim, ease-in, ease-out and ease-in-out (cubic), and ease-{in,out,in-out}-{sine,quad,cubic,quart,quint,expo,circ}.

Opacity at a point t along the fade is 1 - easing(t), so the names read like CSS transitions: ease-out leaves the color quickly and settles gently into transparency.

Choosing a curve

What makes a fade look smooth is how it ends. If opacity is still changing when it reaches 0, you see an edge. The table shows where each curve reaches half opacity, measured on a rendered gradient:

| Curve | 50% opacity at | Ends smoothly | Notes | | -------------------------- | -------------- | ------------- | --------------------------------------------------------------------------------------------- | | linear | 50% | ✗ | Visible edge at both ends, like Tailwind's gradients | | scrim | 37% | ✓ | Andreas Larsen's "scrim" curve: most coverage while staying smooth, good for text over images | | ease-out-quad | 30% | ✓ | | | ease-out-cubic (default) | 21% | ✓ | Smooth, but most of the color sits in the first third | | ease-out-quart/expo | 16% / 10% | ✓ | Short, concentrated shadows | | ease-in-out-* | 50% | ✓ | Smooth at both ends but steepest in the middle, so it looks like a soft band | | ease-in-* | 50%+ | ✗ | Holds the color, then cuts off with a hard edge at the transparent end |

As a rule of thumb, use scrim or ease-out-* for overlays, ease-in-out-* when the fade sits in the middle of a surface, and avoid ease-in-* unless the transparent end is clipped by the element's edge.

Configuration

By default the plugin picks the stop count per curve. To fix it for every fade, set fadekit.steps in a JS config loaded with @config:

@import 'tailwindcss';
@config "./tailwind.config.js";
@plugin "fadekit";
// tailwind.config.js
module.exports = {
  theme: { extend: { fadekit: { steps: 8 } } },
};

Legacy classes

Classes from earlier versions keep working: fade-{t,b,l,r,tl,tr,bl,br}, fade-{easing}-{steps} (e.g. fade-ease-in-cubic-12), fade-ease-{easing} and fade-ease-[{easing}]. Prefer fade-to-{dir} and fade-{easing}/{steps}.

How it works

  • Every utility sets one custom property: --fade-color, --fade-angle or --fade-stops. The color utility draws the gradient from them, which is why classes compose in any order. These properties are registered with inherits: false, so nested elements don't pick up their parent's fade.
  • Stops are computed from the easing function at build time. They're denser where the curve bends the most (spacing ∝ 1/√|f″|), which halves the error of evenly spaced stops for cubic and steeper curves. Without an explicit count, the plugin adds stops until the gradient is within ~1/255 of the real curve (8–21 stops depending on the curve).
  • Colors use relative color syntax, oklch(from var(--fade-color) l c h / calc(alpha * x)), which keeps a color's own alpha so opacity modifiers work.

Credits

Inspired by Smooth Gradient Overlays by Shu Ding and Easing Linear Gradients by Andreas Larsen.

License

MIT