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-filter blur not working in Safari #491

Open
sebastinto opened this issue Mar 31, 2024 · 2 comments
Open

backdrop-filter blur not working in Safari #491

sebastinto opened this issue Mar 31, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@sebastinto
Copy link

Using backdropFilter() with a blur() CSSFilter is not working in Safari.

This is reproducible by navigating to https://bitspittle.dev/blog/2022/kotlin-site in Safari and observing that the header backdrop is translucent instead of blurred.

Safari

Screenshot 2024-03-31 at 1 42 28 PM

Chrome

Screenshot 2024-03-31 at 1 43 48 PM

As a workaround in my project I'm using this which seems to be working fine:
fun Modifier.backdropFilter(vararg filters: CSSFilter) = styleModifier {
    if (filters.isNotEmpty()) {
        listOf("backdrop-filter", "-webkit-backdrop-filter").forEach {
            property(it, filters.joinToString(" "))
        }
    }
}

but since I'm not well-versed in web development, I'm unsure whether this is a proper fix.

  • OS: MacOS
  • Kobweb libs version: 0.17.1
  • Kobweb CLI version: 0.9.15
@sebastinto sebastinto added the bug Something isn't working label Mar 31, 2024
@bitspittle
Copy link
Collaborator

BTW meant to thank you for filing this. I'm also glad you found and shared a workaround. I will look into updating the code in Kobweb.

I was trying to avoid the hacky "-webkit-" prefixes that seem to pervade so many projects, but more because I thought that was an indication that the CSS property was still experimental. However, backdrop-filter not working for Safari is kind of a big deal.

@bitspittle bitspittle self-assigned this Apr 8, 2024
bitspittle added a commit that referenced this issue Apr 12, 2024
Safari still requires the "-webkit-" prefix for this feature.
See also: https://bugs.webkit.org/show_bug.cgi?id=224899

Fixes #491
@bitspittle
Copy link
Collaborator

This should be fixed in 0.17.2 when it goes out (aiming for tomorrow, pending some local tests).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants