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

AstroJS collections are not accessible inside tailwind.config file #11831

Closed
1 task
willpinha opened this issue Aug 24, 2024 · 2 comments
Closed
1 task

AstroJS collections are not accessible inside tailwind.config file #11831

willpinha opened this issue Aug 24, 2024 · 2 comments
Labels
needs triage Issue needs to be triaged

Comments

@willpinha
Copy link

Astro Info

Astro                    v4.14.5
Node                     v21.7.1
System                   Linux (x64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             @astrojs/react
                         @astrojs/tailwind

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

I cannot use Astro collections inside the tailwind.config file, since the module "astro:content" is not defined

[postcss] Cannot find module 'astro:content'

What's the expected result?

Use a collection inside the tailwind.config file, since I have a collection with colors definitions and want to build custom Tailwind colors dynamically based on them

Link to Minimal Reproducible Example

https://stackblitz.com/edit/withastro-astro-1yjmkk?file=tailwind.config.mjs

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 24, 2024
@willpinha willpinha changed the title AstroJS collections are not accessible inside tailwind.config file AstroJS collections are not accessible inside tailwind.config file Aug 24, 2024
@ematipico
Copy link
Member

Collections weren't designed to be imported in a tailwind configuration file.

Also, I don't think we have a documentation page where we show how you can do that.

Closing as it's not a bug

@ematipico ematipico closed this as not planned Won't fix, can't repro, duplicate, stale Aug 24, 2024
@willpinha
Copy link
Author

Thanks for the answer! I'll think of an alternative solution. I will also pay attention to the right place to ask my questions.

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

No branches or pull requests

2 participants