Tailwind CSS changes not applied till server restart

Hello.

I’m trying out Tailwind CSS with Hugo. I’m not using any starters or anything, just a pretty empty website as of now. However, any class name that I add does not show changes till I restart the server. The class is getting added to the HTML just fine, but it’s not being added to the generated stylesheet until I restart the server.

I can’t figure out if it’s something wrong that I’m doing (most likely), or a Tailwind problem or a Hugo problem.

Does anyone have any idea related to this or any clues from where I can start digging. Here’s a repo to test: GitHub - Hrishikesh-K/Hugo-Tailwind: Hugo + Tailwind CSS.

In the HTML files, try changing class names or adding new ones. The changes are only correctly reflected once server is restarted.

Hugo does not recompile the CSS on HTML layout changes. This is slow and most likely not what you want.

Long story short, turn off the purge when not in production (e.g. when you’re developing):

1 Like

That makes sense. Thanks a lot @bep.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.