This project converts Laaravel blade templates from Bulma CSS to Tailwind CSS using calls to a large language model (LLM) API. It simplifies the process of modernizing Bulma CSS-based templates to Tailwind CSS while maintaining functionality and readability.
It can optionally add in A11Y html/css and attempt to add responsive tailwind/html into the template.
To set up this project, follow these steps:
Clone the repository to your local machine:
git clone https://github.com/ohnotnow/bulma2tailwind.git
cd bulma2tailwind
Set up a virtual environment and install dependencies from requirements.txt
:
python -m venv venv
source venv/bin/activate # Linux/macOS
venv\Scripts\activate # Windows
pip install -r requirements.txt
To run the code and convert Bulma CSS-based templates to Tailwind CSS, use the following steps:
Activate the virtual environment:
source venv/bin/activate # Linux/macOS
venv\Scripts\activate # Windows
Execute the main script:
export OPENAI_API_KEY=sk-.....
cd /path/to/your/templates
python /path/to/cloned/repo/main.py
This will start the conversion process, scanning for Laravel Blade templates with Bulma CSS and converting them to Tailwind CSS.
export OPENAI_API_KEY=sk-....
python main.py --file=/path/to/single/template.blade.php
python main.py --dir=/path/to/template/base/dir/
# optionally add a11y and responsive features - can be combined with other flags or omitted
python main.py --css --a11y --responsive
This project is licensed under the MIT License. See the LICENSE file for more details.