Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tailwind Integration with Page With Astro.glob method! #8046

Closed
1 task done
santoshyadav-29 opened this issue Aug 12, 2023 · 3 comments
Closed
1 task done

Tailwind Integration with Page With Astro.glob method! #8046

santoshyadav-29 opened this issue Aug 12, 2023 · 3 comments
Labels
needs response Issue needs response from OP

Comments

@santoshyadav-29
Copy link

santoshyadav-29 commented Aug 12, 2023

What version of astro are you using?

v2.0

Are you using an SSR adapter? If so, which one?

Netlify

What package manager are you using?

npm

What operating system are you using?

Window

What browser are you using?

Edge

Describe the Bug

I was creating a personal blog website using Astro. I used TailwindCSS for styling. I had almost finished my work and was about to deploy but something weird happened.
Suddenly the styles from one of my pages (Blog List page) where I brought all my blog content got removed. All of my other pages are working fine with Tailwind, but this one does not seem to work. I tried rewriting the code and reconfiguring the system but it was the same. As if it worked on my local machine when I just save it and then when I try to restart the server, the page styles got removed.

What's the expected result?

The styles on the blog page should be consistent with the rest of the website, as seen on other pages that use Tailwind CSS.

Link to Minimal Reproducible Example

https://github.com/santoshyadav-29/Blog

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Aug 12, 2023
@natemoo-re
Copy link
Member

A few things could be happening here.

I would try following the most recent version of our blog starter template which uses content collections and see if that fixes things?

@natemoo-re natemoo-re added needs response Issue needs response from OP and removed needs triage Issue needs to be triaged labels Aug 14, 2023
@santoshyadav-29
Copy link
Author

I tried putting the tailwind directives thinking it would solve the issue, even without tailwind directives the results are same. I founds out about content collection API and it works and I will be fine by that but this unexpected behaviour might ruin many developers experience, even in the official astro documentation there is the tutorial on creating a blog with the same approach without CSS so it is a common think to do for people. I hope this problem will be resolved and if not an official note should be provided.

@matthewp
Copy link
Contributor

Closing, content collections is the recommendation to prevent style bleed and similar issues. Astro.glob will likely be deprecated in a future Astro version for this reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs response Issue needs response from OP
Projects
None yet
Development

No branches or pull requests

3 participants