chai-tailwind-mini
v1.0.2
Published
A mini Tailwind-like utility CSS engine
Maintainers
Readme
🍵 Chai Tailwind (Mini Tailwind CSS Engine)
A lightweight, runtime utility-first CSS engine inspired by Tailwind CSS.
Chai Tailwind scans your HTML, detects chai-* classes, and dynamically injects CSS into your page — no build step required 🚀
✨ Features
- ⚡ Zero build setup
- 🎯 Utility-first classes (like Tailwind)
- 🧠 Runtime CSS generation
- 🌐 Works directly in browser (CDN)
- 📦 Also available via npm
🚀 Quick Start (CDN)
Just include this script in your HTML:
<script src="https://cdn.jsdelivr.net/gh/Mehtab-786/tailwind-mini/dist/chai-tailwind.js"></script>That’s it — your chai-* classes will start working automatically.
🧪 Example Usage
<h1 class="chai-text-3xl chai-font-bold chai-bg-purple chai-text-white chai-p-4">
Hello Chai Tailwind 🚀
</h1>
<p class="chai-bg-orange chai-shadow-xl chai-p-4">
This is a paragraph with background, shadow, and padding.
</p>📦 NPM Usage
Install:
npm install chai-tailwind-miniUse:
import { startChai } from "chai-tailwind-mini";
startChai();🧠 How It Works
- Scans DOM for
chai-*classes - Matches them with predefined styles
- Generates CSS dynamically
- Injects styles into
<head>
🎨 Available Utility Classes
📏 Spacing (Padding)
chai-p-1 → padding: 0.25rem
chai-p-2 → padding: 0.5rem
chai-p-4 → padding: 1rem
chai-p-6 → padding: 1.5rem
chai-p-8 → padding: 2rem📐 Margin
chai-m-1 → margin: 0.25rem
chai-m-4 → margin: 1rem
chai-m-auto → margin: auto🎨 Background Colors
chai-bg-red
chai-bg-blue
chai-bg-green
chai-bg-yellow
chai-bg-purple
chai-bg-orange
chai-bg-gray
chai-bg-black
chai-bg-white📝 Text Styles
chai-text-xs → 0.75rem
chai-text-lg → 1.125rem
chai-text-3xl → 1.875rem
chai-text-5xl → 3rem
chai-font-light
chai-font-medium
chai-font-bold
chai-font-black
chai-text-center
chai-text-left
chai-text-right🌈 Text Colors
chai-text-red
chai-text-blue
chai-text-green
chai-text-yellow
chai-text-purple
chai-text-orange
chai-text-gray
chai-text-white
chai-text-black📦 Layout
chai-block
chai-inline
chai-flex
chai-grid
chai-hidden🔲 Flexbox
chai-flex-row
chai-flex-col
chai-items-center
chai-justify-center
chai-justify-between
chai-gap-4🧱 Borders
chai-border
chai-border-2
chai-border-4
chai-border-red
chai-rounded
chai-rounded-lg
chai-rounded-full🌫️ Shadows
chai-shadow-sm
chai-shadow
chai-shadow-md
chai-shadow-lg
chai-shadow-xl🎞️ Animations
chai-animate-spin
chai-animate-ping
chai-animate-bounce⚠️ Notes
- Works only in browser (uses DOM)
- No build tools required
- Classes must start with
chai-
🔥 Future Improvements
- Dynamic values (
chai-p-[50px]) - Responsive utilities
- Hover states
- CLI build tool
👨💻 Author
Mehtab Hussain
⭐ Support
If you like this project, consider giving it a ⭐ on GitHub!
