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

tailwind-plugin-boilerplate

v0.1.0

Published

A boilerplate for creating Tailwind CSS plugins

Readme

Tailwind CSS Plugin Boilerplate

A boilerplate for creating Tailwind CSS plugins with TypeScript.

Supporting Tailwind V4.

Installation

npm install tailwind-plugin-boilerplate

Usage

There are multiple ways to use this plugin with Tailwind CSS v4:

Option 1: Import in your CSS file

@layer base, theme, utilities, components;

@import "tailwindcss";
@plugin "tailwind-plugin-boilerplate";

/* Optional: customize the plugin */
@theme {
  /* Custom colors for the example-color match utility */
  --example-color-primary: #ff5733;
  --example-color-secondary: #33ff57;
  --example-color-accent: #5733ff;
}

For this to work, make sure you have PostCSS configured:

// postcss.config.js
export default {
  plugins: [
    "@tailwindcss/postcss",
    // Other plugins...
  ],
}

Option 2: Using with Vite

// vite.config.js
import { defineConfig } from "vite"
import tailwindcss from "@tailwindcss/vite"

export default defineConfig({
  plugins: [
    tailwindcss({
      // If you need additional plugins
      plugins: ["tailwind-plugin-boilerplate"],
    }),
  ],
})

Features

This plugin boilerplate demonstrates several features of Tailwind CSS plugins:

  • Theme integration: Access and use values from the Tailwind theme
  • Custom utilities: Create your own utility classes
  • Custom components: Define reusable component classes
  • Match utilities: Generate utilities with modifiers

Example Components

The plugin includes examples of:

  1. Basic Utility

    <div class="example-utility">...</div>
  2. Component Example

    <div class="example-component">...</div>
  3. Match Utility - Colors

    <div class="example-color-primary">Primary Color Text</div>
    <div class="example-color-secondary">Secondary Color Text</div>
    <div class="example-color-accent">Accent Color Text</div>

Customization

You can customize the plugin behavior through Tailwind's theming system. Here's how to customize the colors for the example-color utility:

/* in your CSS file */
@theme {
  /* Custom colors for the example-color match utility */
  --example-color-primary: #ff5733; /* Customized primary color */
  --example-color-secondary: #33ff57; /* Customized secondary color */
  --example-color-accent: #5733ff; /* Customized accent color */
}

Plugin Structure

The plugin demonstrates three main types of Tailwind extensions:

  1. Utilities (addUtilities): Simple utility classes that apply specific CSS properties

    addUtilities({
      ".example-utility": {
        position: "relative",
        display: "inline-block",
        gap: theme("spacing.4", "1rem"),
      },
    })
  2. Components (addComponents): More complex, reusable components

    addComponents({
      ".example-component": {
        padding: "1rem",
        borderRadius: theme("borderRadius.md", "0.375rem"),
      },
    })
  3. Match Utilities (matchUtilities): Dynamic utilities with modifiers

    matchUtilities(
      {
        "example-color": (value) => ({
          color: value,
        }),
      },
      {
        values: {
          primary: theme("example-color-primary", "#3b82f6"),
          secondary: theme("example-color-secondary", "#10b981"),
          accent: theme("example-color-accent", "#f59e0b"),
        },
      },
    )

Development

  1. Clone the repository
  2. Install dependencies with npm install
  3. Run development build with npm run dev
  4. Build the plugin with npm run build
  5. Check the example in the /example folder

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT