Codeigniter 4 w/ Tailwind CSS |
Hi,
I am successfully using Tailwind CSS in my CodeIgniter 4 project. If anyone still searching it, then I followed below steps: Step 1: In the CodeIgniter project folder, run below commands to install node package and create blank tailwind.config.js Code: npm install -D tailwindcss Step 2: Update tailwind.config.js as below: Code: /** @type {import('tailwindcss').Config} */ Step 3: Create input.css with below code. You can create it anywhere. I created at app > Views > css > input.css Code: @tailwind base; Step 4: On terminal in CodeIgniter project folder, run below command. If you using different path for input.css and output css (mine styles.css) then change path accordingly. Code: npx tailwindcss -i ./app/Views/css/input.css -o ./public/assets/css/styles.css --watch Step 5: Now just include out css file (mine styles.css) in your php files. With Step 4 command, it will keep running, so if you add any tailwind css class in php file, it will automatically add that to output css file. Hope this helps! |
Messages In This Thread |
Codeigniter 4 w/ Tailwind CSS - by rmartin93 - 01-26-2023, 04:34 PM
RE: Codeigniter 4 Tailwind CSS tutorial - by Corsari - 04-09-2023, 08:46 AM
RE: Codeigniter 4 w/ Tailwind CSS - by InsiteFX - 04-09-2023, 11:28 PM
RE: Codeigniter 4 w/ Tailwind CSS - by kcs - 06-28-2023, 02:19 PM
RE: Codeigniter 4 w/ Tailwind CSS - by Corsari - 06-29-2023, 02:48 AM
RE: Codeigniter 4 w/ Tailwind CSS - by encodedigital - 09-08-2023, 04:03 PM
RE: Codeigniter 4 w/ Tailwind CSS - by Reiji - 01-05-2024, 09:51 AM
RE: Codeigniter 4 w/ Tailwind CSS - by nyctophile08k - 02-24-2024, 06:39 AM
RE: Codeigniter 4 w/ Tailwind CSS - by dgvirtual - 01-06-2025, 11:00 AM
RE: Codeigniter 4 w/ Tailwind CSS - by Bosborne - 01-08-2025, 11:09 AM
RE: Codeigniter 4 w/ Tailwind CSS - by dgvirtual - 01-08-2025, 11:20 AM
RE: Codeigniter 4 w/ Tailwind CSS - by ALTITUDE_DEV - 03-14-2025, 05:53 AM
|