-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
prefix
option + modifier
+ arbitrary variant
: extra prefix is generated for classes inside variant
#10125
Comments
I think I'm having a similar issue with group This is not working: <div class="tw-group is-published">
<div class="tw-hidden group-[.is-published]:block">
Published
</div>
</div> But found this is working: <div class="tw-group tw-is-published">
<div class="tw-hidden group-[.is-published]:block">
Published
</div>
</div> Is this the same issue? |
Hey! Thank you for reporting this. It made us realize there were two bugs lurking here and so we ended up fixing both! :D The fix from #10214 has been merged and will be available in our next release. In the meantime you can test it using our insiders build: |
Hi. Even using the insiders build on Tailwind Play, I am still running into an issue where TW is adding a prefix in a place where it isn't expected. In my case, I am using Phoenix LiveView, which will add a
and this works perfect when I am not using a prefix. When I am using a prefix though, it is incorrectly adding the prefix to part of the generated class. I am expecting it to add:
but instead it is adding
I created an example in Tailwind Play (using the insiders build which looks like it has (#10214) pulled in: https://play.tailwindcss.com/eBTOwTZWJ3?file=config |
@thecrypticace Seems extra prefix is generated for classes inside "plugin-registered" variant. Should we reopen this issue or open another issue? |
@iwarshak @jhcarl0814 Prefixing classes in |
@iwarshak One way to get around this (we do this in the typography plugin even) is to use an attribute selector for your variant: plugin(({ addVariant }) =>
addVariant('phx-click-loading', ['&[class~=“phx-click-loading”]'])
) That’s the easiest way to opt-out of prefixing on a per-selector basis 👍🏻 |
@adamwathan This seems to do the trick, thanks!, But to be honest I have been using TW for a couple years now and this was not super obvious to me. |
I still get this problem, is there any workaround to this, because adding tw- to non tailwind class is not an ideal way to go. |
.tw-group.tw-is-published .group-\[\.is-published\]\:tw-block {
display: block;
} expected result: .tw-group.is-published .group-\[\.is-published\]\:tw-block {
display: block;
} (Changing from Tailwind Play Link |
Thank you very much! |
prefix: "tw-",
+hover:[&.header-is-scrolled_.menu-list_a]:tw-text-[#FF0000]
generates:
expected result:
Tailwind Play Link
The text was updated successfully, but these errors were encountered: