Summer Sale! All accounts are 50% off this week.

reaz's avatar
Level 5

How is tailwind installed on laravel 8?

I apologize if this is a very noob question.

I have recently started to take some tutorial on tailwind css, which was quite fun. In some of the tutorial it was installed by cdn( for simplicity sake) and in some cases it was installed by npm then configuring tailwind config file and postcss config file to make it work properly.

Now that i have a fresh L8 installation,(No jetstream) the welcome page is built with tailwindcss classes. I am curious to know how is tailwind css installed in L8? I dont see a cdn link , so not via cdn. Was it installed via npm, but i have not run npm install yet. Moreover, there is no tailwind config file or postcss config file. Can anybody help me to understand the background on this. Thanks in advance.

0 likes
5 replies
reaz's avatar
Level 5

Hi thanks for your reply. I have gone through the installation guide in tailwindcss. It lists the steps needed to add tailwind in laravel. It suggests to add Mix's postCss method to process CSS and include tailwindcss as a plugin. I have done this in my previous L7 projects to add tailwind. It worked fine.

I have not done any of those in my fresh L8 application, but tailwind is working. How is this configured? That is what i am curious to know.

Snapey's avatar
Snapey
Best Answer
Level 122

The welcome page has tailwind inspired classes, but all the CSS declarations are in-line within the head section of the page.

You would need to either install jetstream, a TALL stack preset or install Tailwind from its own instructions.

reaz's avatar
Level 5

Hi, thanks for your reply. //The welcome page has tailwind inspired classes, but all the CSS declarations are in-line within the head section of the page//

This was the key. I just checked the head. There is 3000 character long style tag!! In the first look it seemed like they are coming from tailwind. That's where i got confused. Installing tailwind was not my problem , it was actually it was the opposite.I was like, I did not do anything , how the hell tailwind is working.

Snapey's avatar

My guess is that Taylor created the welcome page with Tailwind proper, then ran purgecss to just get the used classes, then inlined the css file content.

Please or to participate in this conversation.