Make any webapp mobile responsive using AI.
AutoCSS is a tool that helps you generate CSS for your web projects using AI. It can analyze your HTML structure and generate responsive CSS that makes your website look great on all devices.
- Generate CSS using AI
- Upload individual files or entire project folders
- Download generated projects as a zip file
- View generation history
- Copy generated code to clipboard
-
Clone the repository:
git clone https://github.com/plowsai/auto-css.git cd auto-css
-
Install dependencies:
npm install
-
Create a
.env
file in the root directory with the following variables:OPENAI_API_KEY=your_openai_api_key PORT=3001
To start the application in production mode:
npm start
This will start the server at http://localhost:3001 (or the port specified in your .env file).
For development with auto-restart on file changes:
npm run dev
- Open your browser and navigate to http://localhost:3001
- Upload a file or folder using the upload buttons
- Enter a prompt describing the CSS you want to generate
- Click "Generate" to create the CSS
- View the generated CSS in the output section
- Copy the code to clipboard or download the entire project
server.js
- Express server and API endpointspublic/
- Static files and browser-compatible React appsrc/
- React components (for development)lib/
- Utility functions and API helpersuploads/
- Temporary storage for uploaded filesoutput/
- Generated project files
ISC
This repository contains a simple HTML website template that you can use to test the AutoCSS tool. The website includes common elements and structures that would benefit from responsive styling.
test-website.html
- The main HTML file with a complete website structuretest-website.js
- JavaScript file with interactive functionality
- Download both files to your local machine
- Go to the AutoCSS application (http://localhost:3001)
- Click on the "Upload File" button in the input field
- Select the
test-website.html
file - Optionally, you can also upload the
test-website.js
file - Enter a prompt describing the style you want (e.g., "Create a modern, responsive design with a dark theme and smooth animations")
- Click "Generate" to create the CSS
- View the generated CSS in the output section
- Use the Preview panel to see how the website looks with the generated CSS
- Download the complete project when satisfied
The test website includes various elements that will benefit from responsive styling:
- Navigation menu with mobile toggle
- Hero section with image and call-to-action buttons
- Features grid with cards
- About section with text and image
- Testimonials slider
- Contact form
- Footer with multiple columns
Use the Preview panel in AutoCSS to test how the generated CSS looks at different screen sizes:
- Mobile (320px - 425px)
- Tablet (768px)
- Desktop (1024px+)
Feel free to modify the HTML or JavaScript files to test different structures or add more elements as needed.
If you encounter a "Failed to generate code" error:
- Make sure your server is running correctly
- Check that the HTML file is properly formatted
- Try uploading just the HTML file without the JavaScript
- Restart the AutoCSS server if needed
Happy styling!