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

Using multiple values in :where/:is/:not produces invalid CSS with @apply #6251

Closed
silvenon opened this issue Dec 3, 2021 · 2 comments · Fixed by #6311
Closed

Using multiple values in :where/:is/:not produces invalid CSS with @apply #6251

silvenon opened this issue Dec 3, 2021 · 2 comments · Fixed by #6311
Assignees

Comments

@silvenon
Copy link

silvenon commented Dec 3, 2021

What version of Tailwind CSS are you using?

v3.0.0-alpha.2

What build tool (or framework if it abstracts the build tool) are you using?

Just Tailwind CLI.

What version of Node.js are you using?

v16.13.0

What browser are you using?

It isn't relevant to this bug.

What operating system are you using?

macOS

Reproduction URL

https://github.com/silvenon/repro/tree/tailwind-variant-comma

Describe your issue

The following bug only happens when using @apply.

I'm trying to create a plugin which adds a variant that uses more than one value inside :where (can also be :is or :not, doesn't matter), e.g. my-variant:where(.one, .two, .three). Using a single selector works fine, but using multiple values generates invalid CSS. My plugin contains the following:

addVariant('my-variant', '&:where(.one, .two, .three)')

My input.css looks like this:

@layer components {
  .test {
    @apply my-variant:text-red-500;
  }
}

After running npx tailwindcss --input input.css --output output.css I get the following invalid CSS:

.test:where(.one {
  --tw-text-opacity: 1;
  color: rgb(239 68 68 / var(--tw-text-opacity))
}
@RobinMalfait
Copy link
Member

Hey! Thank you for your bug report!
Much appreciated! 🙏

I will look into this and provide a fix!

@silvenon
Copy link
Author

Wow, thanks! ❤️

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

Successfully merging a pull request may close this issue.

2 participants