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

clases

v1.1.20

Published

A high-performance, recursive, and type-safe utility for managing CSS classes. Designed specifically for Tailwind CSS users who want to replace messy string concatenations with structured, maintainable objects.

Readme

🚀 Class Utilities

A high-performance, recursive, and type-safe utility for managing CSS classes. Designed specifically for Tailwind CSS users who want to replace messy string concatenations with structured, maintainable objects.

✨ Features

  • 🔄 Deep Recursion: Nest variants like md: { hover: '...' } to stack prefixes automatically.
  • 🛡️ Hard Typing: Full IntelliSense autocomplete for all Tailwind variants and custom plugins.
  • 🔌 Stackable Plugins: Merge multiple design systems or custom configurations into a single cl function.
  • 🗜️ Zero Overhead: Built on top of tailwind-merge and clsx for optimal performance and conflict resolution.
  • 📦 Monorepo Ready: Lightweight, tree-shakable packages.

📦 Packages

| Package | Description | | :------------------ | :------------------------------------------------------------------ | | clases | The recursive engine. Use this to build custom variants or plugins. | | clases-tailwind | Pre-configured with all Tailwind CSS variants and type definitions. |


🚀 Quick Start

1. Installation

pnpm add clases-tailwind clases

2. Basic Usage

import { cl } from 'clases-tailwind';

const className = cl({
    base: 'p-4 text-sm transition-all',
    hover: 'bg-blue-500 text-white',
    md: 'text-lg p-8',
    dark: {
        base: 'bg-gray-900',
        hover: 'bg-gray-800'
    }
});

💡 Advanced Use Cases

🔄 Recursive Stacking (The "Secret Sauce")

Stop repeating prefixes. Nesting objects automatically stacks variants in the correct order.

cl({
    md: {
        hover: {
            base: 'scale-105',
            after: 'content-["*"]'
        }
    }
});
// Result: "md:hover:scale-105 md:hover:after:content-['*']"

🛠️ Custom Plugin Management

You can stack the Tailwind plugin with your own semantic aliases or project-specific configs.

import { createCl } from 'clases';
import { tailwind } from 'clases-tailwind';

const cl = createCl(tailwind, {
    hocus: 'hover:focus',
    brand: 'text-indigo-600 dark:text-indigo-400'
});

cl({
    hocus: 'outline-none ring-2',
    brand: 'font-bold'
});

📂 Clean Multi-line Layouts

Use backticks and commas to organize large chunks of layout logic without losing readability.

cl({
    base: `
    grid grid-cols-1,
    gap-4 items-center,
    w-full max-w-7xl mx-auto
  `,
    lg: 'grid-cols-3 gap-8'
});

⌨️ Why Objects?

| Feature | Standard Tailwind Strings | Class Utilities Objects | | :-------------- | :-------------------------- | :------------------------ | | Readability | ❌ Hard to scan long lines | ✅ Grouped by variant | | Maintenance | ❌ Easy to forget prefixes | ✅ Automatic stacking | | Logic | ❌ Messy ternary operators | ✅ Native JS object logic | | Types | ❌ String-based (no safety) | ✅ Full Autocomplete |


🛠️ API Reference

cl(...inputs)

The main utility function. Accepts strings, arrays, objects, or nested structures.

createCl(...plugins)

Factory function to create a customized cl instance. Merges all provided objects into a single type-safe registry.

tailwind

The raw plugin data containing all Tailwind CSS variants.


📄 License

MIT © Mauricio Frías