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

atomiccss-gen

v0.1.2

Published

Tiny atomic CSS generator with arbitrary values support

Downloads

11

Readme

atomiccss-gen

A tiny atomic CSS generator that lets you define utility classes like w-[50%], bg-[red], p-[10px] and generates real CSS on the fly. Think of it as a minimal, zero-config alternative to Tailwind CSS, with support for arbitrary values out of the box.

npm version License: MIT

🚀 Features

  • Zero config: Works out of the box with no setup required
  • Arbitrary values: Use any CSS value with the [value] syntax
  • Watch mode: Automatically update CSS when your files change
  • Small footprint: Generates only the CSS you actually use
  • TypeScript support: Written in TypeScript with type definitions

📦 Installation

Global Installation

npm install -g atomiccss-gen

Local Project Installation

npm install atomiccss-gen --save-dev

One-time Use

npx atomiccss-gen

🛠️ Usage

Generate CSS for a single class

atomiccss-gen w-[50%]
# Output: .w-\[50\%\]{width:50%;}

Generate multiple classes

atomiccss-gen w-[50%] h-[200px] text-[#ff5500]
# Output:
# .w-\[50\%\]{width:50%;}
# .h-\[200px\]{height:200px;}
# .text-\[\#ff5500\]{color:#ff5500;}

Note: The special characters in class names like [, ], %, #, etc. are automatically escaped in the generated CSS selectors, as required by CSS syntax rules. This ensures the selectors work correctly in all browsers.

Scan a project and generate CSS file

atomiccss-gen --scan ./src --out ./styles/atomic.css

Watch mode

atomiccss-gen --scan ./src --out ./styles/atomic.css --watch

📚 Supported Utility Classes

The library currently supports the following utility classes:

| Prefix | CSS Property | Example | | ---------- | ------------------ | ------------------------- | | w- | width | w-[50%] | | h- | height | h-[200px] | | text- | color | text-[#ff0000] | | bg- | background-color | bg-[#f5f5f5] | | p- | padding | p-[10px] | | px- | padding-left/right | px-[20px] | | py- | padding-top/bottom | py-[15px] | | pt- | padding-top | pt-[5px] | | pr- | padding-right | pr-[5px] | | pb- | padding-bottom | pb-[5px] | | pl- | padding-left | pl-[5px] | | m- | margin | m-[10px] | | mx- | margin-left/right | mx-[20px] | | my- | margin-top/bottom | my-[15px] | | mt- | margin-top | mt-[5px] | | mr- | margin-right | mr-[5px] | | mb- | margin-bottom | mb-[5px] | | ml- | margin-left | ml-[5px] | | flex- | flex | flex-[1] | | gap- | gap | gap-[10px] | | opacity- | opacity | opacity-[0.5] | | border- | border | border-[1px solid #ccc] | | rounded- | border-radius | rounded-[4px] |

🧩 API Usage

You can also use the package programmatically:

import { generateCssForClass, scanAndGenerate } from "atomiccss-gen";

// Generate CSS for a single class
const css = generateCssForClass("w-[50%]");
console.log(css); // .w-[50%]{width:50%;}

// Scan a project and generate CSS
scanAndGenerate({
  srcDir: "./src",
  outFile: "./styles/atomic.css",
  watch: true,
});

🤝 Contributing

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

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

See CONTRIBUTING.md for more details.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.