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

Focus visible doesn't work with @apply in CSS module #6194

Closed
agusterodin opened this issue Nov 24, 2021 · 11 comments · Fixed by #6875
Closed

Focus visible doesn't work with @apply in CSS module #6194

agusterodin opened this issue Nov 24, 2021 · 11 comments · Fixed by #6875

Comments

@agusterodin
Copy link

agusterodin commented Nov 24, 2021

What version of Tailwind CSS are you using?

3.0.0-alpha.2

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

Next 12.0.4

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

Test.module.css

.testClass {
  @apply focus-visible:ring-4 focus-visible:ring-teal-300;
}

Describe your issue

Focus visible doesn't work using @apply with CSS modules as of 3.0 alpha 2. It works fine if I revert back to alpha 1.

@adamwathan
Copy link
Member

Hey! Can you please provide a proper reproduction (a repo we can clone that replicates your particular setup)?

@agusterodin
Copy link
Author

Yes, will do tomorrow morning

@gynekolog
Copy link

gynekolog commented Nov 24, 2021

Same issue with focus and tailwindcss 2.2.19.

The issue comes with @apply in CSS module and without using the same utilities in the global css file or in className.
image

reproduction: https://codesandbox.io/s/youthful-sky-9ktgf?file=/src/pages/index.tsx

edit: updated example with tailwindcss 3.0.0 -> https://codesandbox.io/s/patient-platform-pm5qx?file=/src/pages/index.tsx

@agusterodin
Copy link
Author

agusterodin commented Nov 24, 2021

Same issue with focus and tailwindcss 2.2.19.

The issue comes with @apply in CSS module and without using the same utilities in the global css file or in className. image

reproduction: https://codesandbox.io/s/youthful-sky-9ktgf?file=/src/pages/index.tsx

Thank you. I was about to do it, I promise 😀

@agusterodin
Copy link
Author

Can confirm that when just using normal utility classes focus visible rings work fine (--tw-ring-inset and --tr-ring-offset are set to /* */ if I don't explicitly use them) whereas when using @apply inside a CSS module I get these errors and the ring doesn't work

Screen Shot 2021-11-26 at 3 47 35 PM

Screen Shot 2021-11-26 at 3 47 41 PM

@agusterodin
Copy link
Author

In some scenarios this seems to be broken in 3.0 alpha 1 as well (not just alpha 2)

@Jackardios
Copy link

Jackardios commented Dec 7, 2021

Same issue with :focus, I tried 2.1.2, 2.2.19, 3.0.0-alpha.2 and this problem is encountered everywhere with the transform and ring properties.

Next.js 12 + CSS Modules
Screenshot 2021-12-07 at 21 50 42

Screenshot 2021-12-08 at 22 14 52

@hi-reeve
Copy link

got the same issues, working with transform and ring using @apply.

@Andrey-Bazhanov
Copy link

I have same issues in v3

@finkrer
Copy link

finkrer commented Dec 10, 2021

image
Same issue with backdrop filters. No --tw-backdrop-filter is defined, so it does not work.

@agusterodin
Copy link
Author

This issue appears to be resolved in Chrome but not Safari

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants