A comprehensive toolkit for working with Tailwind CSS more efficiently. Generate intelligent color palettes, convert CSS to Tailwind classes, and visualize design components in real-time.
- Intelligent Color Positioning: Automatically positions base colors in the correct shade (50-900) based on lightness analysis
- Dual Color Mode: Generate palettes from one or two base colors with smooth interpolation
- Native Color Pickers: Click any color swatch to customize with native browser color picker
- Multiple Format Support: View colors in both HEX and OKLCH formats
- Tailwind v4 Output: Generate modern
@themeblocks with CSS custom properties - Live Bento Preview: See your colors applied to real UI components instantly
- Smart Contrast: Automatic text color adjustment for optimal readability
- Comprehensive Property Support: Convert a wide range of CSS properties to Tailwind classes
- Specialized Handlers: Enhanced conversion for borders, gradients, shadows, and measurements
- RGBA Color Conversion: Automatic conversion of RGBA colors to closest Tailwind equivalents
- Arbitrary Value Fallbacks: Uses Tailwind's arbitrary value syntax when exact matches aren't available
- Batch Processing: Convert multiple CSS declarations at once
- Live Updates: Automatically updates as you modify colors
- Comprehensive UI Examples: Dashboard cards, charts, forms, calendars, and more
- Contrast Validation: Ensures proper text readability across all color combinations
- Responsive Design: Preview how your colors work across different screen sizes
- Node.js 18+
- npm, yarn, or pnpm
-
Clone the repository
git clone <repository-url> cd tailwind-css-toolkit
-
Install dependencies
npm install # or yarn install # or pnpm install
-
Start the development server
npm run dev # or yarn dev # or pnpm dev
-
Open in browser Navigate to
http://localhost:5173(or the port shown in your terminal)
- Choose your base color using the color picker or enter a hex value
- Optional: Enable "Use two colors" for gradient-based palettes
- Name your color scheme (defaults to "theme")
- Generate palette - the tool automatically positions your color intelligently
- Customize any color by clicking on the color swatches
- Copy the output in either Tailwind v4 @theme format or CSS variables
- Preview in context using the live Bento layout below
@theme {
--color-theme-50: #fef7ee;
--color-theme-100: #fdedd3;
--color-theme-200: #fbd6a5;
--color-theme-300: #f8b86d;
--color-theme-400: #f59332;
--color-theme-500: #f37316;
--color-theme-600: #e4590c;
--color-theme-700: #bc420c;
--color-theme-800: #963612;
--color-theme-900: #7a2e12;
}- Paste your CSS properties into the input area
- Review conversions - the tool shows both original CSS and Tailwind equivalent
- Copy results to use in your project
- Handle edge cases - properties that don't have direct Tailwind equivalents use arbitrary values
/* Input CSS */
background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
border-radius: 12px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
/* Output Tailwind */
bg-gradient-to-br from-red-400 to-teal-400
rounded-xl
shadow-md├── App.tsx # Main application component
├── components/
│ ├── PaletteGenerator.tsx # Color palette generation tool
│ ├── CssToTailwind.tsx # CSS to Tailwind converter
│ ├── BentoLayout.tsx # Live preview component
│ ├── ColorPicker.tsx # Native color picker component
│ ├── ColorSwatch.tsx # Individual color display
│ ├── figma/
│ │ └── ImageWithFallback.tsx
│ └── ui/ # shadcn/ui components
├── utils/
│ ├── color-utils.ts # Color manipulation and generation
│ └── css-to-tailwind.ts # CSS conversion logic
└── styles/
└── globals.css # Tailwind v4 configuration and base styles
- Framework: React 18 with TypeScript
- Styling: Tailwind CSS v4 with custom CSS properties
- UI Components: shadcn/ui component library
- Color Processing: Custom OKLCH color space utilities
- Icons: Lucide React
- Build Tool: Vite
The palette generator analyzes your base color's lightness and automatically positions it in the appropriate shade:
- Very light colors (near white) → 50 shade
- Mid-tone colors → 400-600 shades
- Very dark colors (near black) → 900 shade
Uses OKLCH (Oklab Lightness Chroma Hue) for more perceptually uniform color generation, ensuring better color relationships across the palette.
Generates modern Tailwind v4 @theme blocks instead of legacy JavaScript configuration, making it easy to integrate with the latest Tailwind CSS.
- Color utilities: Extend
utils/color-utils.ts - CSS conversions: Add handlers in
utils/css-to-tailwind.ts - UI components: Follow shadcn/ui patterns in
components/ui/
The project uses Tailwind v4 with CSS custom properties defined in styles/globals.css. Modify the :root and .dark selectors to customize the design system.
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
- Modern browsers with CSS custom properties support
- Chrome 49+, Firefox 31+, Safari 9.1+, Edge 16+
MIT License - feel free to use this project for personal or commercial purposes.
Built with ❤️ using React and Tailwind CSS v4
Need help or have suggestions? Open an issue or contribute to make this toolkit even better!
