-
Notifications
You must be signed in to change notification settings - Fork 41
Support for recursive @apply
#66
Comments
Hey! Yeah sorry this is a known limitation and should be mentioned in the README — currently we don't support recursive I'll update the title for this issue and keep it open until we have implemented it 👍🏻 |
@apply
Try removing the layer decorator. Ours was also not working until we removed the layer decorators and all of our custom CSS started working again.
Is now
|
If I don't declare it within a
|
I thought the layer directive was to place the custom classes in the proper place for CSS ordering as well as making the classes being able to be purged at build. So custom classes should show with and without the layer detractive in regular TW, however the CSS inheritance might be off. I'm just basing this off the docs and you are probably more familiar with this since I only started using TW a couple days ago. So, I don't how many of these rules still apply with JIT enabled. I do know that TW w/JIT is picking up my custom classes and it only did once I removed the layer directives. here is my setup - maybe I'm doing something different but I think my setup is pretty standard. I switched from In my main entry point (I use next so _app.tsx) import tailwind then my custom css file.
|
Should have pretty good basic support for this in v0.1.6 now 👍🏻 |
Awesome, working great! 👍🏻 |
I agree this is now working. I wanted to leave a note that at first I felt like this was not working, but rearranging my components to use my master "main.css" vs. my "component css" fixed the issue. I am using vuejs, so my component looked like this:
This didn't work with these fixes, however changing my include to "../../main.css", which includes tailwind and my "components.css" , where my components are defined within a @layer directive, did work. |
All of these work with
tailwindcss
, but with@tailwindcss/jit
they don't, no matter the order ofbg-white
andsome-class
:It looks like
--tw
variables aren't overwritten; in these examples,background-color
is alwaysrgba(255, 255, 255, var(--tw-bg-opacity))
.This is the only I saw it works, but it's weird and the only reason it's working is that the explicit
background-color
replaces the one set via@apply
(final value isred
, so it doesn't go through TW):The text was updated successfully, but these errors were encountered: