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

tailwindest-css-transform

v1.0.7

Published

Tailwindest CSS Transformer

Readme

tailwindest-css-transform

Automate your migration from standard Tailwind CSS to type-safe Tailwindest objects.

Features

  • Zero-Config Migration: Automatically detects your tailwindest setup (namespace, paths) from your project.
  • Smart Auto-Import: Inserts necessary import statements into transformed files automatically.
  • Source-Safe: Uses AST (Abstract Syntax Tree) traversal to ensure code logic remains untouched.
  • Type-Safe: Generates objects that are 100% compatible with tailwindest types.

Installation

# Run directly with npx
npx tailwindest-css-transform <target> [options]

# Or install globally
npm install -g tailwindest-css-transform

Usage

# Transform a single file
npx tailwindest-css-transform src/components/Button.tsx

# Transform an entire directory recursively
npx tailwindest-css-transform src/pages

# Preview changes without modifying files
npx tailwindest-css-transform src --dry-run

# Override auto-discovered config when needed
npx tailwindest-css-transform src \
    --css src/styles/tailwind.css \
    --identifier tw \
    --module @/styles/tailwind \
    --mode runtime

Running npx tailwindest-css-transform without a target opens an interactive prompt that asks only for the file or directory to transform. The CLI then detects the Tailwind CSS entry, Tailwindest createTools export, import path, mode, walkers, and dry-run setting.

CLI Options

| Option | Alias | Default | Description | | :-------------------- | :---- | :------------- | :---------------------------------------------- | | --css <path> | -c | auto-detected | Tailwind CSS entry used to initialize Tailwind. | | --identifier <name> | -i | auto or tw | Tailwindest import identifier. | | --module <path> | -m | auto or ~/tw | Tailwindest module import path. | | --dry-run | -d | false | Preview changes without modifying files. | | --mode <mode> | - | auto | Output mode: auto or runtime. | | --help | -h | - | Display help for command. |

Auto discovery uses the same Tailwind CSS root and Tailwind package resolution helpers as create-tailwind-type. If a local Tailwind package is older than v4, the CLI warns and falls back to the internal Tailwind v4 engine.

Example

Before:

const className =
    "flex items-center justify-center p-4 bg-blue-500 hover:bg-blue-600 text-white rounded-lg transition-colors"

After:

const style = tw.def({
    display: "flex",
    alignItems: "items-center",
    justifyContent: "justify-center",
    padding: "p-4",
    backgroundColor: "bg-blue-500",
    hover: {
        backgroundColor: "hover:bg-blue-600",
    },
    color: "text-white",
    borderRadius: "rounded-lg",
    transitionProperty: "transition-colors",
})

CVA migration

cva(...) declarations are rewritten to the matching Tailwindest styler API. Static variant maps become tw.variants(...), VariantProps becomes GetVariants, and call sites use .class(...) so they match the createTools signatures.

Before:

import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils"

const buttonVariants = cva("inline-flex items-center", {
    variants: {
        variant: {
            default: "bg-primary text-primary-foreground",
            outline: "border bg-background",
        },
        size: {
            default: "h-9 px-4",
            sm: "h-8 px-3",
        },
    },
})

interface ButtonProps extends VariantProps<typeof buttonVariants> {
    className?: string
}

function Button({ className, variant, size }: ButtonProps) {
    return (
        <button className={cn(buttonVariants({ variant, size, className }))} />
    )
}

After:

import { tw } from "~/tw"
import { type GetVariants } from "tailwindest"

const buttonVariants = tw.variants({
    base: {
        display: "inline-flex",
        alignItems: "items-center",
    },
    variants: {
        variant: {
            default: {
                backgroundColor: "bg-primary",
                color: "text-primary-foreground",
            },
            outline: {
                borderWidth: "border",
                backgroundColor: "bg-background",
            },
        },
        size: {
            default: {
                height: "h-9",
                padding: "px-4",
            },
            sm: {
                height: "h-8",
                padding: "px-3",
            },
        },
    },
})

interface ButtonProps extends GetVariants<typeof buttonVariants> {
    className?: string
}

function Button({ className, variant, size }: ButtonProps) {
    return (
        <button
            className={tw.join(
                buttonVariants.class({ variant, size }),
                className
            )}
        />
    )
}

When a cva(...) declaration has no variant map, it is emitted as tw.style(...) and call sites use .class(...).


For more details, visit our official documentation.