The global variable `--tw-transform` is not defined in base
See original GitHub issueWhat version of Tailwind CSS are you using?
v3.0.7
What build tool (or framework if it abstracts the build tool) are you using?
tailwindcss-cli 3.0.7
What version of Node.js are you using?
v16.13.0
What browser are you using?
Chrome
What operating system are you using?
macOS
Reproduction URL
https://play.tailwindcss.com/iVIJhwfSBR – Funny thing here: --tw-transform
gets directly added to div:after
and there is no global definition of that variable. Maybe v3.0.1 is the reason for that 😕
Describe your issue
Edit: It seems like this relates to https://github.com/tailwindlabs/tailwindcss/pull/6500
I am using web components which import a shared CSS file that only contains @tailwind base
. When trying to use transform utilities I can also see transform: var(--tw-transform);
.
The problem is that the variable is not defined since that does not live in Tailwind base:
*, ::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));
...
}
Is it possible that we get this moved like the other globals like shadows or content?
*, ::before, ::after {
--tw-ring-offset-shadow: 0 0 #0000;
--tw-ring-shadow: 0 0 #0000;
--tw-shadow: 0 0 #0000;
--tw-shadow-colored: 0 0 #0000;
}
::before,
::after {
--tw-content: '';
}
Thank you!
Issue Analytics
- State:
- Created 2 years ago
- Comments:20 (2 by maintainers)
I have the same issue. I’m using Next.js, Tailwind CSS, twin.macro, and styled-components.
When applying the classes inside the styled-component Div like this, it doesn’t work (with or without the
transform
class) …However, applying the class
-translate-y-1/2
directly to the<div>
element inside the component does work perfectly 😕<div className="-translate-y-1/2">
I’m not sure if it’s a twin.macro issue in my case or is it a configuration issue or what.
In my case, @tailwind base; was not added. After adding transform started working