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

chai-css-aryan

v1.0.4

Published

Mini utility-first CSS engine like Tailwind

Readme

☕ Chai CSS

A mini utility-first CSS engine inspired by Tailwind CSS — built from scratch using JavaScript.

It scans your HTML, detects utility classes, and dynamically generates CSS at runtime.


🚀 Features

  • ⚡ Utility-first CSS approach
  • 🧠 Runtime CSS generation
  • 🎯 Simple and beginner-friendly
  • 📦 Lightweight (no build step required)
  • 🔥 Inspired by Tailwind CSS

📦 Installation

npm install chai-css-aryan

🧑‍💻 Usage

✅ Method 1: Using ES Modules

<script type="module">
  import chaiCSS from "chai-css-aryan";
  chaiCSS();
</script>

✅ Method 2: Local Development

<script type="module">
  import chaiCSS from "../../chai-css/index.js";
  chaiCSS();
</script>

🧾 Example

<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Chai CSS Example</title>
  </head>
  <body>
    <h1
      class="chai-p-4 chai-text-xl chai-bg-green-500 chai-text-white chai-br-lg"
    >
      Hello Aryan 🚀
    </h1>

    <p
      class="chai-p-3 chai-text-base chai-bg-yellow-100 chai-text-gray-700 chai-mt-4"
    >
      Lorem ipsum dolor sit amet consectetur adipisicing elit.
    </p>

    <div class="chai-card">
      <h2 class="chai-text-lg chai-font-bold chai-text-gray-800">Card Title</h2>
      <p class="chai-text-sm chai-text-gray-500 chai-mt-2">
        This is a built-in card component.
      </p>
    </div>

    <script type="module">
      import chaiCSS from "chai-css-aryan";
      chaiCSS();
    </script>
  </body>
</html>

⚙️ Available Utilities

Spacing

| Class | Description | Example Output | | ------------- | ------------------- | ----------------------- | | chai-p-{n} | Padding (all sides) | padding: 16px; | | chai-pt-{n} | Padding top | padding-top: 16px; | | chai-pr-{n} | Padding right | padding-right: 16px; | | chai-pb-{n} | Padding bottom | padding-bottom: 16px; | | chai-pl-{n} | Padding left | padding-left: 16px; | | chai-m-{n} | Margin (all sides) | margin: 16px; | | chai-mt-{n} | Margin top | margin-top: 16px; | | chai-mr-{n} | Margin right | margin-right: 16px; | | chai-mb-{n} | Margin bottom | margin-bottom: 16px; | | chai-ml-{n} | Margin left | margin-left: 16px; |

Spacing scale: 0 · 1=4px · 2=8px · 3=12px · 4=16px · 5=20px — or pass any raw number (e.g. chai-p-2424px).


Typography

| Class | Description | Example Output | | -------------------- | ----------------- | -------------------------------- | | chai-text-{size} | Font size | font-size: 16px; | | chai-font-{weight} | Font weight | font-weight: 700; | | chai-align-left | Text align left | text-align: left; | | chai-align-center | Text align center | text-align: center; | | chai-align-right | Text align right | text-align: right; | | chai-align-justify | Text justify | text-align: justify; | | chai-italic | Italic text | font-style: italic; | | chai-not-italic | Normal style | font-style: normal; | | chai-ul | Underline | text-decoration: underline; | | chai-line-through | Strikethrough | text-decoration: line-through; | | chai-noul | Remove underline | text-decoration: none; | | chai-uppercase | Uppercase text | text-transform: uppercase; | | chai-lowercase | Lowercase text | text-transform: lowercase; |

Font sizes: xs=12px · sm=14px · base=16px · lg=18px · xl=20px

Font weights: thin · extralight · light · normal · medium · semibold · bold · extrabold · black


Colors

All color utilities follow the pattern chai-{property}-{color}-{shade}.

| Class | Description | Example Output | | ----------------------------- | ---------------- | ----------------------------------- | | chai-bg-{color}-{shade} | Background color | background-color: #3b82f6; | | chai-text-{color}-{shade} | Text color | color: #3b82f6; | | chai-border-{color}-{shade} | Border color | border-color: #3b82f6; | | chai-bg-white | White background | background-color: #ffffff; | | chai-bg-black | Black background | background-color: #000000; | | chai-text-white | White text | color: #ffffff; | | chai-text-black | Black text | color: #000000; | | chai-border-white | White border | border-color: #ffffff; | | chai-border-black | Black border | border-color: #000000; | | chai-bg-{value} | Raw background | background: linear-gradient(...); | | chai-opacity-{n} | Opacity (0–100) | opacity: 0.5; |

Available colors: slate · gray · zinc · red · orange · amber · yellow · lime · green · teal · cyan · sky · blue · indigo · violet · purple · fuchsia · pink · rose

Shades: 100 · 200 · 300 · 400 · 500 · 600 · 700 · 800


Border

| Class | Description | Example Output | | -------------------- | ------------------ | ----------------------- | | chai-b-{n} | Border (all sides) | border: 2px solid; | | chai-border-solid | Solid border | border-style: solid; | | chai-border-dashed | Dashed border | border-style: dashed; | | chai-border-dotted | Dotted border | border-style: dotted; | | chai-border-double | Double border | border-style: double; | | chai-border-none | No border | border-style: none; | | chai-br-{size} | Border radius | border-radius: 8px; |

Radius sizes: none · sm · DEFAULT · md · lg · xl · 2xl · 3xl · full

⚠️ Note: Border radius uses chai-br-{size}, not chai-rounded-{size}.


🃏 Card (Built-in Component)

Chai CSS ships with a ready-to-use card component — no configuration needed. Just add the class and get a styled white card with padding, rounded corners, and a shadow.

| Class | Description | | -------------- | ----------------------------------------- | | chai-card | Default card (24px padding, 12px radius) | | chai-card-sm | Compact card (16px padding, 8px radius) | | chai-card-lg | Spacious card (40px padding, 16px radius) |

<!-- Default card -->
<div class="chai-card">
  <h2>Card Title</h2>
  <p>Some content goes here.</p>
</div>

<!-- Small card -->
<div class="chai-card-sm">
  <p>Compact card content.</p>
</div>

<!-- Large card -->
<div class="chai-card-lg">
  <p>Spacious card content.</p>
</div>

Each variant generates a white background, box shadow, and border radius automatically — no extra classes needed.


Display & Cursor

| Class | Description | | ------------------------- | ----------------------- | | chai-block | display: block | | chai-inline-block | display: inline-block | | chai-inline | display: inline | | chai-hidden | display: none | | chai-cursor-pointer | Pointer cursor | | chai-cursor-default | Default cursor | | chai-cursor-not-allowed | Not-allowed cursor | | chai-cursor-wait | Wait cursor | | chai-cursor-text | Text cursor | | chai-cursor-move | Move cursor | | chai-cursor-auto | Auto cursor |


🧠 How It Works

  1. Scans all elements in the DOM
  2. Extracts class names starting with chai-
  3. Matches them against utility functions (exact match first, then key+value split)
  4. Generates CSS dynamically
  5. Injects styles into a <style id="chai-css"> tag

⚠️ Limitations

  • Runs at runtime (browser), not build-time
  • May impact performance on very large DOM trees
  • No responsive breakpoints or pseudo-class support yet

🔮 Future Improvements

  • 🚀 CLI tool (npx chai-css build)
  • 📁 Config file support
  • ⚡ Build-time optimization (like Tailwind)
  • 🎨 Theme system
  • 📱 Responsive breakpoints (sm:, md:, lg:)
  • 🖱️ Hover & focus variants

🤝 Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.


👨‍💻 Author

Aryan Nandanwar

  • 💻 B.Tech CSE Student
  • 🚀 Building in public
  • 🔥 Passionate about web development & AI

⭐ Support

If you like this project:

👉 Give it a star on GitHub 👉 Share it on LinkedIn 👉 Build something awesome with it