withastro / github-pages

Automatically deploy an Astro site to GitHub Pages
38 stars 12 forks source link

Tailwind CSS not work on GitHub Pages #1

Open molystechie opened 2 years ago

molystechie commented 2 years ago

Hello!

I am styling astro page with Tailwind CSS. But for some reason, the tailwind classes do not appear on the deployed GitHub page although it does show during the local build environment.

I have installed Tailwind through npm install @astrojs/tailwind and follow the official documentation as described on https://docs.astro.build/en/guides/integrations-guide/tailwind/

How to make Tailwind CSS work after deploy on GitHub Pages?

My test project is this one: https://github.com/molystechie/Astro-hello-world

torn4dom4n commented 2 years ago

Did you update Astro to the latest version?

wilfriedago commented 2 years ago

@molystechie You need to specify the correct url, otherwise Tailwind CSS file, can't be loaded, check your network tab in the devtools. Also check my setup. My project : https://github.com/wilfriedago/astrowind

torn4dom4n commented 2 years ago

Hello!

I am styling astro page with Tailwind CSS. But for some reason, the tailwind classes do not appear on the deployed GitHub page although it does show during the local build environment.

I have installed Tailwind through npm install @astrojs/tailwind and follow the official documentation as described on https://docs.astro.build/en/guides/integrations-guide/tailwind/

How to make Tailwind CSS work after deploy on GitHub Pages?

My test project is this one: https://github.com/molystechie/Astro-hello-world

I checked your repo. You need to config base in astro.config.mjs. See this.