-
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
v2.2.8 not generating global variables #5059
Comments
Reverted the main piece of the changes that cause this stuff for v2.2.7, check that out and see if it helps. Hopefully can resolve the underlying issues and bring these improvements back soon. |
@adamwathan looks like it's working (mostly), but I noticed that the var |
@adamwathan just checked and global variables for |
am on 2.2.7 [edit: I tried upgrading to 2.2.9, same problem persists] similar issue as @mattiaz9 — backdrop filters do not work. I am trying to apply a backdrop blur to a modal underlay
and in-browser, the resulting CSS looks like: If I manually change the I've downgraded to 2.2.4 like op and things seem to be working again. |
Hi @mattiaz9 thanks for reporting it Same issue here, noticed kind of bug between v2.2.4 (working) and latest v2.2.16 (broken). From the output of @adamwathan the point is filters related vars are not defined Globals from 2.2.4 (working)Globals from 2.2.16 (broken) |
Another fix for this issue, instead of downgrading to 2.2.4 is to add missing vars to your utility section : @layer utilities {
...
*, ::before, ::after {
--tw-blur: var(--tw-empty,/*!*/ /*!*/);
--tw-brightness: var(--tw-empty,/*!*/ /*!*/);
--tw-contrast: var(--tw-empty,/*!*/ /*!*/);
--tw-grayscale: var(--tw-empty,/*!*/ /*!*/);
--tw-hue-rotate: var(--tw-empty,/*!*/ /*!*/);
--tw-invert: var(--tw-empty,/*!*/ /*!*/);
--tw-saturate: var(--tw-empty,/*!*/ /*!*/);
--tw-sepia: var(--tw-empty,/*!*/ /*!*/);
--tw-drop-shadow: var(--tw-empty,/*!*/ /*!*/);
--tw-filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
--tw-backdrop-blur: var(--tw-empty,/*!*/ /*!*/);
--tw-backdrop-brightness: var(--tw-empty,/*!*/ /*!*/);
--tw-backdrop-contrast: var(--tw-empty,/*!*/ /*!*/);
--tw-backdrop-grayscale: var(--tw-empty,/*!*/ /*!*/);
--tw-backdrop-hue-rotate: var(--tw-empty,/*!*/ /*!*/);
--tw-backdrop-invert: var(--tw-empty,/*!*/ /*!*/);
--tw-backdrop-opacity: var(--tw-empty,/*!*/ /*!*/);
--tw-backdrop-saturate: var(--tw-empty,/*!*/ /*!*/);
--tw-backdrop-sepia: var(--tw-empty,/*!*/ /*!*/);
--tw-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
}
} |
Hey! Thank you for your bug report! The issue here is that your The TL;DR is that css files are split. For your specific use case, you can fix it in 2 ways:
@tailwind base;
@tailwind components;
@tailwind utilities;
.center-content {
@apply absolute left-1/2 top-1/2;
@apply transform -translate-x-1/2 -translate-y-1/2;
}
@tailwind base;
@tailwind components;
@tailwind utilities;
@import "../components//CenterContent//center-content.scss" In general, I don't really see the benefit in splitting your css files like this. The final output is already pretty small. import React from "react"
const CenterContent: React.FC = ({ children }) => {
return (
<div className="absolute left-1/2 top-1/2 transform -translate-x-1/2 -translate-y-1/2">
{children}
</div>
)
}
export default CenterContent |
What version of Tailwind CSS are you using?
2.2.6
What build tool (or framework if it abstracts the build tool) are you using?
vite 2.4.3, postcss 8.3.6, typescript 4.3.5
What version of Node.js are you using?
v14
What browser are you using?
Safari, Chrome
What operating system are you using?
macOS
Reproduction repository
https://github.com/mattiaz9/tailwind-global-variable-issue
Describe your issue
I believe is the same issue as this: #5034
What I noticed is that the problem occurs when using
@apply
rather than utility classes.To run the reproduction repository:
yarn && yarn dev
The text was updated successfully, but these errors were encountered: