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

valcss

v0.0.2

Published

Tiny utility to generate CSS

Downloads

6

Readme

⚡ valcss

valcss is a tiny, flexible CLI utility to generate atomic and utility-first CSS classes from usage in your HTML and custom plugins. It allows you to configure class patterns, outputs, breakpoints, and even inject CSS directly into your HTML or as a separate file.

Table of Contents


Features

  • ⚡ Instantly extracts and generates a CSS file from your HTML.
  • ⏳ Supports watch mode for live editing.
  • 🧩 Extendable through custom plugins.
  • 🔗 CSS injection: inline in HTML or as a .
  • 📦 Zero-dependency CLI.
  • 🌈 Supports breakpoints (responsive utilities).
  • 📝 Customizable with a simple JS config file.

Installation

npm install -g valcss

Getting Started

1. Scaffold a config file

valcss init

This creates a valcss.config.js file in your project:

// valcss.config.js
module.exports = {
  files: ["index.html", "src/**/*.html"],
  output: "valcss-main.css",
  inject: {
    mode: "link", // or "inline"
    targets: ["index.html"],
  },
  breakpoints: {
    lg: 990,
  },
  plugins: [
    ({ addUtilities }) => {
      addUtilities(
        {
          "flex-center": {
            display: "flex",
            "justify-content": "center",
            "align-items": "center",
          },
        },
        "*"
      );
    },
  ],
};

2. Add utility CSS classes in your HTML:

Example (index.html):

<link rel="stylesheet" href="valcss-main.css" />
<div class="p-[25px] flex-center hover:flex-center lg:flex-center ...">
  <p class="text-[#000] bg-[#00ff00] border-[1px_solid_#000] ...">Hello</p>
</div>

3. Build your CSS

valcss
  • This scans your HTML, generates only the CSS classes you actually use, and writes them to valcss-main.css.
  • The CSS is injected (as a link or inline) into your specified HTML targets.

Configuration

The config file lets you control:

  • files: Files/globs to scan for class usage.
  • output: The CSS file output.
  • inject: How and where to inject the styles.
  • breakpoints: Custom responsive breakpoints.
  • plugins: Extendable utility generators.

See valcss.config.js for an example.


Usage

| Command | Description | | ------------------------ | ------------------------------------ | | valcss | Run CSS extraction/generation | | valcss --output <file> | Override the default output file | | valcss --watch | Enable file watching/live rebuilds | | valcss init | Scaffold a config file | | valcss --dry-run | Print generated CSS to terminal only | | valcss --help | Show help message |

Example:

valcss --watch --output custom.css

Plugin System

Define your own utilities with the plugins array in your config:

plugins: [
  ({ addUtilities }) => {
    addUtilities(
      {
        "flex-center": {
          display: "flex",
          "justify-content": "center",
          "align-items": "center",
        },
      },
      "*"
    );
  },
];

This adds the flex-center class to your utility set:

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

Injection Modes

  • "link": Injects your built CSS using <link rel="stylesheet" ...>.
  • "inline": Injects the CSS directly inside <style> tags.
  • Targets: Specify which HTML files receive the injection.

Edit these options under inject in your config file.


Live Example


FAQ

How does valcss work?

  • Scans your specified files for ALL CSS classes used.
  • Resolves and compiles only the classes you use into a single CSS file.
  • Optionally injects that file into your HTML via link or inline style.

How to add my own utility classes?

Use the plugin system in the config. See Plugin System.

Does valcss support responsiveness?

Yes! Example:
.md:utility or .lg:flex-center generates the correct breakpoint selectors.


License

MIT © 2025 @hardik-143


Ready to make your CSS minimal, maintainable, and fast? Try valcss and get instant atomic CSS using only what you use!