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

v2.2.5 not generating global variables #5034

Closed
mrtnbroder opened this issue Jul 21, 2021 · 6 comments · Fixed by #5038
Closed

v2.2.5 not generating global variables #5034

mrtnbroder opened this issue Jul 21, 2021 · 6 comments · Fixed by #5038

Comments

@mrtnbroder
Copy link

mrtnbroder commented Jul 21, 2021

What version of Tailwind CSS are you using?

v2.2.5

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

nextjs v11

What version of Node.js are you using?

14

What browser are you using?

Chrome

What operating system are you using?

macOS

Reproduction repository

https://codesandbox.io/s/modest-morning-53dm6?file=/src/styles/index.css

Describe your issue

After upgrading to the latest patch version, it seems like there is now a bug with the transform property. the CSS being generated:

position: absolute;
top: 0px;
right: 0px;
--tw-translate-x: -0.875rem;
transform: var(--tw-transform);
--tw-translate-y: 0.875rem;
transform: var(--tw-transform);

as you can see, it generated --tw-translate-y and --tw-translate-x but tries to use --tw-transform which is not available or set anywhere.

This is how it's being generated:

.class {
  @apply absolute top-0 right-0 -translate-x-3.5 translate-y-3.5;
}

UPDATE:

Sorry, i just downgraded and see that it's actually because it's not generating variables for *, ::after, ::before

  // this is missing in 2.2.5
*, ::before, ::after {
  ...
  --tw-transform: translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
  ...
}
@mrtnbroder mrtnbroder changed the title transform using wrong variable v2.2.5 not generating global variables Jul 21, 2021
@adamwathan
Copy link
Member

Hey! Please provide a reproduction repository, this behavior has changed (with JIT only) but is still intended to work, just works differently now:

#4850

This is in production on tailwindcss.com and all transforms and stuff are working correctly there so there must be something else contributing that isn't captured in this issue.

@mrtnbroder
Copy link
Author

@adamwathan here you go: https://codesandbox.io/s/modest-morning-53dm6?file=/src/styles/index.css

If you inspect the button element, you'll see the bug I described above.

@adamwathan
Copy link
Member

Should be fixed in v2.2.6, thank you for helping me find this one!

@mrtnbroder
Copy link
Author

Thank you!

@mattiaz9
Copy link

I still have this problem with tailwind 2.2.6 using vite and JIT. Downgrading to 2.2.4 fixed it.

@adamwathan
Copy link
Member

@mattiaz9 Please open a new issue with a reproduction.

@tailwindlabs tailwindlabs locked and limited conversation to collaborators Jul 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants