-
Notifications
You must be signed in to change notification settings - Fork 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
Tailwind v3, Vue, Vite, @apply any transform #6342
Comments
Same issue. Same build tools. Except i'm using nextjs and not vue/vite. |
I am seeing the same thing , buildtools webpack v5.47 + tailwindcss v3 + postcss v8.4.4 .. but also postcss-import 14.0.2 and postcss-import-ex-glob 2.0.1. As far as I can see it is related with postcss-import and postcss-import-ex-glob because if I add the css rules with the @apply and transforms directly to my main,css, it works as expected |
As workaround I did * {
@apply rotate-0;
} in my index.scss file and all transforms now works correctly |
In my main.css I now did, and it also works: |
This solution actually breaks all fixed positioned elements as you can not use them with a parent having a transform property. |
yeah, you're correct.. but I don't have those yet in my current project until next week ;-) .. the rotate-0 hack doesn't work for me |
My workaround - not so workaround - is to manually add <div
className={clsx(
'motion-safe:transition-all transform',
className,
styles.modalClose,
{
[styles.modalOpen]: isOpen,
}
)}
> Which is not what we want here with tailwind v3, as it officialy says we could get rid of this I guess there is a problem using transform properties with Made another test here : https://play.tailwindcss.com/oJyqCSnd7R and while inspecting elements, we can see vars are actually defined, so maybe we are missing something on the tailwind setup. |
a temporary solution - as @ferdinanddoremus mentioned , we can add a |
That doesn't work for ::before and ::after unfortunately |
I have the same issue and in my case, I think postcss-import cause it. it will work /* app.css */
.working {
@apply rotate-45;
} but it will not work /* app.css */
@import 'foo.css'
/* foo.css */
.not-working {
@apply rotate-45;
} Using:
|
Same here. |
This is mine config: module.exports = {
plugins: ['tailwindcss/nesting', 'tailwindcss', 'postcss-flexbugs-fixes'],
} I am using @apply in my CSS modules, I am using the same styling technique as vercel's commerce project https://github.com/vercel/commerce/blob/main/components/checkout/PaymentMethodView/PaymentMethodView.module.css |
I previously used the default nextjs postcss configuration from the example, but after discovering this problem I tried other combinations, some of which have been mentioned above by other peoples . |
Hey folks! We've patched a fix for this in v3.0.2 👍 It involved disabling this new |
What version of Tailwind CSS are you using?
3.0.0
What build tool (or framework if it abstracts the build tool) are you using?
"vue": "3.2.24",
"autoprefixer": "10.4.0",
"postcss": "8.4.4",
"tailwindcss": "3.0.0",
"vite": "2.7.1",
What version of Node.js are you using?
16.13.1
What browser are you using?
Chrome, Safari
What operating system are you using?
macOS Monterey
Reproduce link
https://stackblitz.com/edit/vitejs-vite-3t2bb4?file=src/components/HelloWorld.vue
Describe your issue
Any transform is not working with
@apply
in Vue, but works in playgroundIn my index.scss
The text was updated successfully, but these errors were encountered: