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

backdrop-blur-none still applies a blur #13821

Closed
adamwathan opened this issue Jun 11, 2024 Discussed in #13820 · 2 comments
Closed

backdrop-blur-none still applies a blur #13821

adamwathan opened this issue Jun 11, 2024 Discussed in #13820 · 2 comments
Assignees

Comments

@adamwathan
Copy link
Member

Discussed in #13820

Originally posted by skoshx June 11, 2024
Using backdrop-blur-none still applies a blur (although it is 0px)

.backdrop-blur-none {
    --tw-backdrop-blur: blur(0);
    -webkit-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);
    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);
}

The expected behavior is to remove any backdrop blur?

Basically, I have a component that merges tailwind classes, and by default has backdrop-blur-sm, after merging the backdrop-blur-none class overrides the previous, but it doesn't set --tw-backdrop-blur: none, instead it sets it to blur(0) which actually still creates a blur effect.

@adamwathan
Copy link
Member Author

I think the fix for this is just going to be this:

  .backdrop-blur-none {
-     --tw-backdrop-blur: blur(0);
+     --tw-backdrop-blur: ;
      -webkit-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);
      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);
  }

@RobinMalfait
Copy link
Member

This was indeed the fix, before this looking at the backdrop-filter value it would say blur(0px), now with the empty value it results to none (assuming no other filter is active).

This should now be fixed by #13830

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

No branches or pull requests

2 participants