Deploy removes body classes

Is there any reason why the Netlify deploy of my Astro site removes the Tailwind body classes?

I have this in my index.astro

<body class="flex flex-col items-center h-screen h-[100svh] leading-tight font-body">

After deploy

<body>

Hi @itsjustmyron, this error is due to tailwind not finding any classes to scan in the directories containing HTML.
Make sure you have tailwind.config.js file in your project with the settings below.

 content: [
    './pages/**/*.{html,js}',
    './components/**/*.{html,js}',
  ],

The above code determines which files are to be scanned and processed by tailwind.
For more information regarding the above, kindly visit the Tailwind Official Documentation page in the link below.
Official documentation:

Let me know the outcome.
Thanks.

Thanks @clarnx. I had this in my tailwind.config.js file already:

module.exports = {
  content: ['./src/**/*.{md,astro,html,svelte,vue,js,ts,jsx,tsx}'],

I should also mention that classes on all other tags render correctly after deploy and everything (including <body>) builds correctly locally.

Update: After upgrading my local packages, I have this happening locally as well. Looks like it is caused by one or more upgrades.

Hi @itsjustmyron, create a minimal production of your site to see if it works or not. This helps you to rule out possible causes.

I think this is an issue with the current Astro build. My workaround for now is moving the classes to the <main> tag.

1 Like

@itsjustmyron, glad to know you were able solve the problem.
Thanks.