Skip to content

This extension provides instant Tailwind support to Laravel Mix builds.

License

Notifications You must be signed in to change notification settings

bhushan/tailwind-mix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tailwind Mix

npm NPM npm npm bundle size

This extension provides instant Tailwindcss support to Laravel Mix builds.

Usage

First, install the extension.

npm install tailwind-mix --save-dev

Then, require it within your webpack.mix.js file, like so:

let mix = require('laravel-mix');

require('tailwind-mix');

mix
    .js('resources/js/app.js', 'public/js')
    .sass('resources/sass/app.scss', 'public/css')
    .tailwind();

Next steps

This package requires tailwind configuration (tailwind.js or tailwind.config.js), so don't forget to run:

npx tailwindcss init

Above command will create tailwind.js or tailwind.config.js file for you.

In case for any reason you want to change file name to different from default you can pass file path as an argument.

Example:

mix
    .js('resources/js/app.js', 'public/js')
    .sass('resources/sass/app.scss', 'public/css')
    .tailwind('./filename.js');

app.scss file example:

@import "tailwindcss/base";
@import "tailwindcss/components";
@import "tailwindcss/utilities";

And you're done! Compile everything down with npm run dev

More information about the Tailwind directives to your Sass/Less entry file.

About

This extension provides instant Tailwind support to Laravel Mix builds.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published