Open psmedia90 opened 6 years ago
Dunno what you are trying to do, but I got it to work quite effortlessly.
After you install it, create the config file:
./node_modules/.bin/tailwind init
change your mix config to this. (I'm using purgecss, if you are not, remove the references.)
const mix = require("laravel-mix");
const tailwindcss = require("tailwindcss");
require("laravel-mix-purgecss");
mix
.js("resources/js/app.js", "dist/js")
.sass("resources/sass/app.scss", "dist/css")
.options({
processCssUrls: false,
postCss: [tailwindcss("./tailwind.js")]
})
.purgeCss();
Put this in your app.scss.
Should work now when you run dev or production on laravel-mix.
PS: also, when using apply, remove the dot before the class. Example
@apply text-white py-2 px-4;
ran into this same issue just now. I don't have a forsure solution, but I have a hunch that it is because we have bootstrap loaded as well, and it is confused as to whether or not we are referring to bootstrap's text-white or tailwind's..
going to continue to look into this now to confirm
also.. hunch #2 => using something like purgeCss or any other 'unused rule trimmer' tool could fix this under the condition that you aren't using the rule that causes this conflict as the build tool would be removing the conflicted class definition..
open to discuss
@1337erik I've just run into this problem and am using Bootstrap in the same project too
@adamwathan I am having an error show up when I run
NPM run dev
.here are the versions i am using
Laravel: 5.6.34
TailWindCss: 0.6.5
"laravel-mix-tailwind": "^0.1.0"
i am using sass not less.
Here is the error
Package.json
Webpack.mix.js
app.scss
components/forms
let me know if you need to see any other files
Thank You