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

darkwind

v0.1.8

Published

A Tailwind CSS plugin for automatic inverted dark mode colors.

Readme

Darkwind

"Tailwind blows, Darkwind adapts."

Darkwind is an auto-dark plugin for Tailwind CSS with zero-config inverted colors. Write bg-x-slate-200, and get slate-800 (or 700) in dark mode automatically. The default palette has 11 steps (50 → 950); x- classes invert those steps in dark mode. Darkwind is rule-based, predictable, and configurable. It adapts dark mode colors using math, not hardcoded strategies.

Get Started

Installation

npm install darkwind
# or
pnpm add darkwind
# or
yarn add darkwind

Configuration

Add it to your tailwind.config.js:

module.exports = {
  darkMode: 'class', // Required for the plugin to work
  plugins: [require('darkwind')()],
}

Examples

Now use the x- prefix:

<html class="dark">
  <div class="bg-x-slate-100 text-x-slate-900">
    This card adapts to the wind.
  </div>
</html>

Features

  • Drop-in prefix: Use x- in front of default palette colors to get automatic dark equivalents.
  • Predictable mapping: Math-based inversion across the 11 shade steps (50 → 950), with tunable offsets.
  • White/black handling: Edge colors map into the shade spectrum via edgeFamily.
  • Opacity friendly: Works with slash modifiers like bg-x-sky-500/50.
  • Tailwind v3/v4 compatible: Works in both Tailwind v3 and v4.
  • VS Code Preview: x- classes (e.g., bg-x-sky-500/50) show color previews in VS Code.

VS Code color preview for x- classes

How it works

1) Supported Tailwind palette colors

Darkwind targets the default tailwindcss/colors palette only (custom colors are not included):

  • Shade-based colors (e.g., red-300, sky-700)
  • Edge colors (white, black)

2) Shade-based colors

For palette colors like slate-100 or gray-500:

  • Mirror at 500 (symmetric inversion).
  • Apply offset by shifting the result by shade steps in this sequence: 50 → 100 → 200 → 300 → 400 → 500 → 600 → 700 → 800 → 900 → 950
  • Clamp to the ends of the sequence (and to minShade / maxShade if configured).
  • Snap to the nearest valid shade (50–950, ties round up).

3) white / black

  • Compute a virtual shade for white/black.
  • If the result is within 50–950, output {edgeFamily}-{shade}.
  • If it falls outside, keep white or black.

📊 Showcase mapping examples (documentation only)

These are illustrative examples, not API options. Use numeric options instead.

| Example | symmetric (default) | modern | darker | | :-----: | :-----------------: | :----: | :----: | | offset | 0 | 1 (lighter) | -1 (darker) | | maxShade | 1000 | 950 | 1000 | | minShade | 0 | 50 | 100 | | Mapping | | | | | white | black | gray-950† | black† | | 50 | 950 | 900 | black | | 100 | 900 | 800 | 950 | | 200 | 800 | 700 | 900 | | 300 | 700 | 600 | 800 | | 400 | 600 | 500 | 700 | | 500 | 500 | 400 | 600 | | 600 | 400 | 300 | 500 | | 700 | 300 | 200 | 400 | | 800 | 200 | 100 | 300 | | 900 | 100 | 50 | 200 | | 950 | 50 | 50 | 100 | | black | white | gray-50† | gray-100† |

  • † edgeFamily-applied value.

Options

offset (Number)

  • Default: 0
  • Applied after symmetric inversion.
  • Calculated in shade steps:
    • 1: shift one step toward lighter shades (modern)
    • 0: perfectly symmetric inversion
    • -1: shift one step toward darker shades
  • Note: Although Tailwind shade numbers increase toward darkness, offset follows lightness semantics: + means lighter, - means darker.

minShade (Number)

  • Default: 0
  • Lower clamp for the result shade. The computed shade will not go below this value.

maxShade (Number)

  • Default: 1000
  • Upper clamp for the result shade. The computed shade will not go above this value.

edgeFamily (String)

  • Default: 'gray'
  • Used only when the input is white or black.
  • This only applies when white or black are mapped into the shade spectrum.
  • Since white/black have no shade, Darkwind computes a virtual shade. If the result falls within 50–950, it becomes {edgeFamily}-{shade}.
    • Example: white → gray-950
    • Example: black → gray-50
  • This option only applies to white and black in the default Tailwind palette.

prefix (String)

  • Default: 'x'
  • Changes the class name prefix (e.g., my-slate-100).

tailwindVersion (Number)

  • Default: 4
  • Set to 3 for Tailwind v3 projects so opacity modifiers like /50 are supported.
  • Note: v3 opacity uses color-mix(), so make sure your target browsers support it.

Defaults

Darkwind defaults to a symmetric, mathematically neutral inversion:

  • offset: 0
  • maxShade: 1000
  • minShade: 0

🔧 Configuration Example (symmetric default)

// tailwind.config.js
module.exports = {
  // ...
  darkMode: 'class', // Required for the plugin to work
  plugins: [
    require('darkwind')(),
  ],
}

For modern UI contrast, we recommend:

🔧 Configuration Example (modern)

// tailwind.config.js
module.exports = {
  // ...
  darkMode: 'class', // Required for the plugin to work
  plugins: [
    require('darkwind')({
      offset: 1, // Modern inversion (default: 0)
      maxShade: 950, // default: 1000
      minShade: 50, // default: 0
    }),
  ],
}