Automatically generate comprehensive style guides from any website using AI
Style Stealer analyzes any website's design system and generates a professional Markdown style guide covering colors, typography, layout, spacing, and visual patterns.
- β¨ Automatic Style Extraction - Analyzes HTML & CSS to extract design tokens
- π¨ Comprehensive Analysis - Colors, typography, layout, spacing, and visual patterns
- π€ AI-Powered - Uses Claude AI to generate human-readable style guides
- β‘ Fast & Efficient - Hybrid scraping strategy (Cheerio + Playwright fallback)
- π± Universal - Works with any public website (static or JavaScript-heavy)
- πΎ Export Ready - Download style guides as Markdown files
- Node.js 18+ or Node.js 22 LTS (recommended)
- npm or pnpm
- Anthropic API key (Get one here)
-
Clone the repository
git clone <your-repo-url> cd style-stealer
-
Install dependencies
npm install
-
Set up environment variables
Create a
.env.localfile in the root directory:ANTHROPIC_API_KEY=your_anthropic_api_key_here
Get your API key from Anthropic Console
-
Run the development server
npm run dev
-
Open your browser
Navigate to http://localhost:3000
- Enter any website URL in the input field
- Click "Generate Style Guide"
- Wait 10-30 seconds while the app:
- Scrapes the website
- Analyzes design patterns
- Generates a professional style guide
- Copy or download the Markdown output
https://stripe.comhttps://github.comhttps://airbnb.comhttps://tailwindcss.com
User Input (URL)
β
βββββββββββββββββββββββββββ
β 1. Scraping Service β
β - Try Cheerio (fast) β
β - Fallback: Playwright β
βββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββ
β 2. Parser Service β
β - Extract colors β
β - Extract typography β
β - Extract layout β
β - Extract spacing β
β - Extract visuals β
βββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββ
β 3. AI Service β
β - Claude 3.5 Haiku β
β - Generate Markdown β
βββββββββββββββββββββββββββ
β
Style Guide (Markdown)
- Next.js 15 - React framework with App Router
- React 19 - UI library
- TypeScript - Type safety
- Tailwind CSS - Styling
- Cheerio - Fast HTML parsing
- Playwright - Browser automation (fallback)
- Lightning CSS - CSS parsing
- Anthropic SDK - Claude AI integration
- Zod - Input validation
style-stealer/
βββ app/
β βββ api/
β β βββ generate/
β β βββ route.ts # API endpoint
β βββ page.tsx # Main UI page
β βββ layout.tsx # Root layout
β βββ globals.css # Global styles
βββ lib/
β βββ types.ts # TypeScript types
β βββ utils.ts # Utility functions
β βββ scraper.ts # Web scraping service
β βββ parser.ts # CSS parsing service
β βββ ai.ts # Claude AI integration
βββ components/ # (empty - inline components)
βββ .env.local # Environment variables
βββ package.json
βββ tsconfig.json
βββ tailwind.config.ts
βββ next.config.ts
Generate a style guide from a website URL.
Request Body:
{
"url": "https://example.com"
}Success Response (200):
{
"success": true,
"markdown": "# Style Guide: Example...",
"tokens": { ... },
"generationTime": 15234
}Error Response:
{
"success": false,
"error": "Error message",
"generationTime": 5000
}| Variable | Description | Required |
|---|---|---|
ANTHROPIC_API_KEY |
Your Anthropic API key for Claude | Yes |
Edit lib/scraper.ts to customize:
timeout- Request timeout (default: 30000ms)userAgent- Custom user agent stringforcePlaywright- Skip Cheerio, use Playwright directly
Edit lib/parser.ts to customize:
minColorFrequency- Minimum color occurrences to include (default: 2)groupSimilarColors- Group similar colors (default: true)colorSimilarityThreshold- Color grouping threshold (default: 20)
Approximate costs per generation (using Claude 3.5 Haiku):
- Simple website: $0.01 - $0.02
- Medium website: $0.02 - $0.05
- Complex website: $0.05 - $0.10
- Use Claude 3.5 Haiku (default) - most cost-efficient
- Enable color grouping to reduce token count
- Limit extracted values (edit parser settings)
- Consider batch processing for multiple sites
- Push your code to GitHub
- Import project in Vercel Dashboard
- Add
ANTHROPIC_API_KEYenvironment variable - Deploy
The app can be deployed to:
- Netlify - Add build command:
npm run build - AWS Amplify - Configure Next.js SSR
- Cloudflare Pages - Use Node.js compatibility mode
- Railway - Add environment variables in dashboard
- Ensure
.env.localexists and containsANTHROPIC_API_KEY - Restart the development server after adding environment variables
- Some websites are slow to respond
- Try increasing timeout in
lib/scraper.ts - Use
forcePlaywright: trueoption
- Website may be JavaScript-heavy
- Playwright fallback will activate automatically
- Check console logs for scraping method used
- Default: 10 requests per hour per IP
- Edit rate limiting in
app/api/generate/route.ts - Consider implementing Redis-based rate limiting for production
npm run devnpm run build
npm run startnpx tsc --noEmitnpm run lint- Add markdown rendering preview (not just plain text)
- Export to JSON design tokens
- Export to Figma tokens format
- Dark mode detection
- Component library recognition (Bootstrap, Material UI, etc.)
- Screenshot comparison tool
- Accessibility audit (WCAG contrast ratios)
- Batch processing for multiple URLs
- User accounts and saved style guides
- Browser extension for one-click generation
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT License - see LICENSE file for details
- Built with Next.js
- AI powered by Anthropic Claude
- Web scraping with Cheerio and Playwright
- Styled with Tailwind CSS
For issues, questions, or suggestions:
- Open an issue on GitHub
- Contact: [your-email@example.com]
Made with β€οΈ by the Style Stealer team