3

Some classes like text-green-500, rounded are having effect and the styling is updated.

Ohter classes, like bg-black, don't have any effect on the styling.

I am using Jetstream and TailwindCSS.

Eric Landheer
  • 2,033
  • 1
  • 11
  • 25
zyen
  • 39
  • 2
  • Welcome to SO! Your question is difficult to answer without any context. Perhaps you can provide a [minimal example](https://stackoverflow.com/help/minimal-reproducible-example)? Could be numerous reasons: Did you recompile? What does your tailwind configuration look like? Are your purging classes perhaps? If you update your answer, we can help you better! – Eric Landheer Jul 09 '21 at 15:34
  • have you used `npm run dev` to mix your `.css` files after changing it? –  Jul 09 '21 at 15:49

5 Answers5

2

I have solve this problem before with this :

npm run prod

this might help you

Abilogos
  • 4,777
  • 2
  • 19
  • 39
0

There are plenty of possibilities which may cause this, but as a kind of a workaround you could use the safelist in the tailwind.config.js, as follows:

    purge: {

      content: [
     './vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php',
    './vendor/laravel/jetstream/**/*.blade.php',
    './storage/framework/views/*.php',
    './resources/views/**/*.blade.php',
    ],
    safelist: [
        'rounded',
        'text-green-500',
    ],
},

and don't forget to run npm run dev.

p.s. for some reason, sometimes npm run dev is not enough and I have to go for npm run watch, and ctrl+c it after the mix recompile is over. Don't know what could the reason be, but it helped.

Kay
  • 61
  • 3
0

If you add some html with tailwind CSS elements not used before then just run 'npm run dev' and that should add the CSS classes.

After that, you can start the server using 'php artisan serve'

shahil
  • 941
  • 9
  • 20
0

While you're developing run npm run watch, it will refresh the CSS requirements whenever you save a page.

npm run prod is for once you have finished developing and want to put the site into production.

Aaron Harker
  • 173
  • 1
  • 2
  • 11
-1

As suggested by @DaviMendesDev you need to run npm to compile your classes for use.

npm run dev

or

npm run prod

this will generate .css files you can use.

Toby Allen
  • 10,997
  • 11
  • 73
  • 124