Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

beertastic's avatar

Laravel 12 - livewire starter kit. No tailwind.config.js file?

Am I missing s'thing? I'm trying to add a few things (fluxUI pro, powergrids) and they reference adding code to tailwind.config.js in the root DIR, but it's not there. Am I doing s'thing dumb?

0 likes
3 replies
LaryAI's avatar
Level 58

In Laravel projects, especially when using Livewire and Tailwind CSS, the tailwind.config.js file is essential for customizing your Tailwind CSS setup. If you don't see this file in your project, it might be because it wasn't generated during the initial setup. Here's how you can create and configure it:

  1. Install Tailwind CSS: If you haven't already installed Tailwind CSS, you can do so using npm. Run the following command in your project directory:

    npm install tailwindcss
    
  2. Generate the Tailwind Configuration File: You can generate a tailwind.config.js file by running:

    npx tailwindcss init
    

    This command will create a basic tailwind.config.js file in the root of your project.

  3. Customize the Configuration: Once you have the tailwind.config.js file, you can customize it according to the requirements of the packages you're using (like FluxUI Pro or PowerGrids). For example, you might need to extend the theme, add plugins, or configure the purge options.

    Here's a basic example of what the tailwind.config.js might look like:

    /** @type {import('tailwindcss').Config} */
    module.exports = {
      content: [
        './resources/**/*.blade.php',
        './resources/**/*.js',
        './resources/**/*.vue',
      ],
      theme: {
        extend: {
          // Customizations go here
        },
      },
      plugins: [
        // Add any plugins you need
      ],
    }
    
  4. Rebuild Your Assets: After setting up your tailwind.config.js, make sure to rebuild your assets using Laravel Mix or Vite, depending on your setup. For example, if you're using Vite, you can run:

    npm run dev
    

    This will compile your assets and apply the Tailwind CSS configurations.

By following these steps, you should be able to set up and customize your Tailwind CSS configuration in a Laravel project using Livewire. If you encounter any issues, ensure that all dependencies are correctly installed and that your build process is running without errors.

Rebwar's avatar

When you install Laravel 12, Tailwind CSS v4 is installed automatically. In Tailwind CSS v4, you don’t need tailwind.config.js file because you can configure all of your customizations directly in the CSS file where you import Tailwind. That’s why you don’t see tailwind.config.js file in your project.

If you still want to use tailwind.config.js file, you can manually load it using the @config directive.

@config "../../tailwind.config.js";
14 likes

Please or to participate in this conversation.