-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Arbitrary values in arrays not picked up #11387
Comments
Hey! Can you please provide a reproduction? Definitely is applicable 🫣 |
I pasted your code into Tailwind Play and it looks like all of the classes are picked up: https://play.tailwindcss.com/UGlr6X9Xvm Are you scanning the source file for classes or the compiled file? I tested both and both are working here. Really need a reproduction to be able to help more. |
Of course — my bad! Tailwind Play with repro.
Edit: I've removed as much from the snippet as I could while still not seeing the class in the css output. |
Hey @gukj I'm struggling to see how you end up in that scenario exactly. The long version: export const imageOverlayClasses = cva(
[
'w-full',
'bg-gradient-to-t',
'from-black/[85]',
'to-transparent',
]
) Should work fine. The minified version should work fine as well: dx=se(["w-full","bg-gradient-to-t","from-black/[85]","to-transparent"]) But I'm struggling to see how you end up at: [a:"[]]from-black/[85] If you simplify the minified version by dropping classes that aren't relevant I would expect to end up with something like this: dx=se(["w-full","bg-gradient-to-t","from-black/[85]","to-transparent"])
se(["w-full","bg-gradient-to-t","from-black/[85]","to-transparent"])
x(["w-full","bg-gradient-to-t","from-black/[85]","to-transparent"])
x(["from-black/[85]"]) We did do some fixes that will be available in the next release, but you can already try them in the insiders version:
That said, I have 2 questions for you:
|
Going to close this issue for now, feel free to comment if the issue still occurs using the insiders built. I know this version fails right now: dx=se(["w-full","bg-gradient-to-t","from-black/[85]","to-transparent"])
se(["w-full","bg-gradient-to-t","from-black/[85]","to-transparent"])
x(["w-full","bg-gradient-to-t","from-black/[85]","to-transparent"])
x(["from-black/[85]"]) Then I think this is not an issue to worry about. |
@RobinMalfait I got to that state by just reducing the original string, so no worries there. Looks like 3.3.3 fixes the issue I had with the original minified source — thanks! 🎉 |
Aha beautiful, glad its working! |
What version of Tailwind CSS are you using?
v3.3.2
What build tool (or framework if it abstracts the build tool) are you using?
postcss 8.4.24, Next.js 13.4.4, react 18.2.0
What version of Node.js are you using?
v20.1.0
What browser are you using?
Chrome, Safari, Firefox
What operating system are you using?
macOS 13.13.1 (a)
Reproduction URL
Tailwind Play with repro.
from-black/[85]
appears in the snippet but does not appear in the css output.Describe your issue
I'm using a package of components that uses
cva
for some styles. The styles are sometimes structured like:Which is compiled to a
index.js
where the styles show up as... dx=se(["w-full","bg-gradient-to-t","from-black/[85]","to-transparent"] ...
. For some reason,from-black[85]
isn't picked up by tailwind, whilew-full
,bg-gradient-to-t
andto-transparent
is.Makes me think that the regex is missing arbitrary styles when they're nested in brackets.
Might be related to #11241
The text was updated successfully, but these errors were encountered: