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

Tailwindcss Adding component classes does not work #4371

Closed
1 task
igorovic opened this issue Aug 17, 2022 · 2 comments
Closed
1 task

Tailwindcss Adding component classes does not work #4371

igorovic opened this issue Aug 17, 2022 · 2 comments

Comments

@igorovic
Copy link

What version of astro are you using?

1.0.6

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

None

What package manager are you using?

pnpm

What operating system are you using?

Mac

Describe the Bug

According to tailwindcss documentation you should be able to create a custom component class. example doc

I tested with this simple example:

@components {
  .issue-1 {
    @apply bg-red-400;
    outline: 1px solid red;
  }
}

The problem is that this @components directive should be striped away in the final css. However, with astro tailwind integration it's not the case.

Here is a screenshot of the final result with astro.

issue-1

Link to Minimal Reproducible Example

https://github.com/igorovic/learn-astro

Participation

  • I am willing to submit a pull request for this issue.
@DerYeger
Copy link
Contributor

Can you try @layer components as seen here?

@bluwy
Copy link
Member

bluwy commented Aug 18, 2022

I think @DerYeger is right here, and the docs linked also recommends @layer components. I think it's a typo so I'll close this for now. Feel free to let me know if I'm mistaken though!

@bluwy bluwy closed this as not planned Won't fix, can't repro, duplicate, stale Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants